Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Stripping spaces using a REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
prasanth_bs

New User


Joined: 08 Aug 2005
Posts: 9

PostPosted: Wed Dec 13, 2006 5:59 pm    Post subject: Stripping spaces using a REXX
Reply with quote

My input file is of the following order

Code:
Code:

0001|abc                                |1234
0002|abncd                            |1235
0003|abdn                              |4567



My output Files needs to be like

Code:
Code:

0001|abc|1234
0002|abncd|1235
0003|abdn|4567



ie, I want to trim all the spaces in the column2.

Can I do using Rexx ultility.

** SuperK ** I edited the post to include the CODE tags as an example of why they are extremely valuable **
Back to top
View user's profile Send private message
References
acevedo

Senior Member


Joined: 11 May 2005
Posts: 314
Location: Spain

PostPosted: Wed Dec 13, 2006 6:07 pm    Post subject:
Reply with quote

use STRIP builtin in column 2 (or SPACE builtin to the whole... it depends on what you want).
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 255

PostPosted: Wed Dec 13, 2006 6:47 pm    Post subject: Re: Stripping spaces using a REXX
Reply with quote

prasanth_bs, you do realize that your before and after examples look exactly the same, both here and in your other posts? You need to use the CODE BBCode tags around your data so that all the spacing and formatting is preserved.
Back to top
View user's profile Send private message
acevedo

Senior Member


Joined: 11 May 2005
Posts: 314
Location: Spain

PostPosted: Wed Dec 13, 2006 7:31 pm    Post subject:
Reply with quote

IMHO they don't look the same

0003|abdn |4567
0003|abdn|4567

anyway it's a good advice to use tags.
Back to top
View user's profile Send private message
Marso

Senior Member


Joined: 13 Mar 2006
Posts: 325
Location: Israel

PostPosted: Wed Dec 13, 2006 7:58 pm    Post subject:
Reply with quote

SPACE will suppress all spaces in all columns:
Code:
LINEOUT = SPACE(LINEIN,0)

If you want to limit the change to column 2 only, do:
Code:
PARSE VAR LINEIN COL1 '|' COL2 '|' COL3
LINEOUT = COL1'|'SPACE(COL2,0)'|'COL3
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1