IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Stripping spaces using a REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prasanth_bs

New User


Joined: 08 Aug 2005
Posts: 9

PostPosted: Wed Dec 13, 2006 5:59 pm
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
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Dec 13, 2006 6:07 pm
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: 234

PostPosted: Wed Dec 13, 2006 6:47 pm
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

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Dec 13, 2006 7:31 pm
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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Dec 13, 2006 7:58 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top