Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

acevedo

Active User


Joined: 11 May 2005
Posts: 344
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: 234

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

Active User


Joined: 11 May 2005
Posts: 344
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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us