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
 

 

Rexx file formatting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
hithamanu

New User


Joined: 07 Jan 2011
Posts: 4
Location: Chennai

PostPosted: Wed Nov 16, 2011 11:23 am    Post subject: Rexx file formatting
Reply with quote

Hi

I need to format a file using REXX.

Input file

Code:
abcedfgh;23423423;10.05.1987;xx;23546
abcde;23423434;;ff;323
asdfsdf;253658;20.12.1987;t;25698

Output file should look like ::

Code:
abcedfgh;23423423;10.05.1987;xx;23546
abcde$$$;23423434;$$$$$$$$$;ff;323
asdfsdf$$;253658$$;20.12.1987;t$;25698


$ indicate spaces.

Is there anty function in REXX which I can use for this formatting?
i tried this with Parse string. But it dint give the expected output.

Can someone please help me in this?

Thanks in advance
Code:
Code:
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Wed Nov 16, 2011 11:41 am    Post subject:
Reply with quote

Hi

You should try to make use of Refer manual here

Code:


LEFT(<VARIABLE>,8)

Back to top
View user's profile Send private message
hithamanu

New User


Joined: 07 Jan 2011
Posts: 4
Location: Chennai

PostPosted: Wed Nov 16, 2011 11:55 am    Post subject:
Reply with quote

Thanks for the reply. I will try with this option.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1787
Location: UK

PostPosted: Wed Nov 16, 2011 12:14 pm    Post subject:
Reply with quote

Another formatting option:
When posting code etc that needs a fixed font to maintain spacing highlight the code, or whatever, in the reply box and click the Code button above the box. That will give you a nice 'green screen' effect and you would not have to put in all those $.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Wed Nov 16, 2011 9:18 pm    Post subject: Reply to: Rexx file formatting
Reply with quote

If the file is very large, you might want to use SORT instead of a rexx program.
The following:
Code:
//S1      EXEC  PGM=SORT                                       
//SYSOUT  DD    SYSOUT=*                                       
//SORTIN  DD    *                                             
ABCEDFGH;23423423;10.05.1987;XX;23546                         
ABCDE;23423434;;FF;323                                         
ASDFSDF;253658;20.12.1987;T;25698                             
//SORTOUT DD    SYSOUT=*                                       
//SYSIN   DD    *                                             
  OPTION COPY                                                 
  INREC PARSE=(%01=(ENDBEFR=C';',FIXLEN=8),                   
               %02=(ENDBEFR=C';',FIXLEN=8),                   
               %03=(ENDBEFR=C';',FIXLEN=10),                   
               %04=(ENDBEFR=C';',FIXLEN=2),                   
               %05=(FIXLEN=5)),                               
        BUILD=(%01,C';',%02,C';',%03,C';',%04,C';',%05,43C' ')

worked for me with SYNCSORT but should work with DFSORT as well.
Output received:
Code:
ABCEDFGH;23423423;10.05.1987;XX;23546 
ABCDE   ;23423434;          ;FF;323   
ASDFSDF ;253658  ;20.12.1987;T ;25698 
Back to top
View user's profile Send private message
hithamanu

New User


Joined: 07 Jan 2011
Posts: 4
Location: Chennai

PostPosted: Thu Nov 17, 2011 6:32 pm    Post subject:
Reply with quote

Thanks a lot for the replies....
I tried the function LEFT(<VARIABLE>,Len) and it worked.. icon_biggrin.gif
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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