HP3000-L Archives

October 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tim Cummings <[log in to unmask]>
Reply To:
Tim Cummings <[log in to unmask]>
Date:
Mon, 21 Oct 2002 09:10:33 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
I would use the STRING verb.  As in:

MOVE SPACES TO WS-FULLNAME.

STRING WS-FIRSTNAME  DELIMITED BY "  ",
              " ", DELIMITED BY SIZE,
             WS-LASTNAME DELIMITED BY "  "
  INTO  WS-FULLNAME.

The quoted strings above on the name fields contain 2 spaces.

Using the STRING and UNSTRING verbs are hundreds of time faster
than trying to pick apart the string using indexing one character at a time.


Tim Cummings
Cummings Consulting
Cincinnati, OH
513-576-1182

-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]]On Behalf Of
Rao, Raghu
Sent: Friday, October 18, 2002 7:12 PM
To: [log in to unmask]
Subject: [HP3000-L] COBOL : Removing trailing spaces ?

Hi all,

I am having 2 fields WS-FIRSTNAME and WS-LASTNAME. The data in them contains
"JOE              " and "SMITH               "

How do I get my final output to be "JOE SMITH" ?

Any suggestions through INSPECT or EXAMINE or REPLACE SPACES BY NULLS, etc ?
? ? I don't want to use any loop to search each and every field position for
spaces or anything like that..

The data in these 2 fields is left justified but can contain any names and
may not always look like the example provided above. It can also contain
special names like "JOE SR.          " or JOE III           "

Thanks
Raghu.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2