Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1249
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 to send an email without SMTP Se... upendrasri All Other Mainframe Topics 9 Sun Nov 19, 2017 7:59 pm
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 4 Wed Nov 15, 2017 4:27 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us