MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

add text to the end of each record using SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Dec 14, 2007 10:52 am    Post subject: add text to the end of each record using SORT Reply with quote

Members,

I have a file with records as below but the lrecl of the file is 80 bytes and each record contents vary some may 3 chars , 4 , 5 , 10 characters and others too.
Code:

raj
amar
mahesh
raja
vicky
.
.
.

I want the records to be read one by one and be appended with 'good' after each text as below:
Code:

rajgood
amargood
maheshgood
rajagood
vickygood
.
.
.

Please let me know if it can be done by using SORT
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Dec 14, 2007 11:06 am    Post subject: Reply with quote

yadav2005,


The following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *
raj
amar
mahesh
raja
vicky
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  OPTION COPY                                       
  INREC BUILD=(1,80,JFY=(SHIFT=LEFT,TRAIL=C'GOOD'))
//*   


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Fri Dec 14, 2007 10:02 pm    Post subject: Reply with quote

Kolusu,

Thanks for the solution and it works fine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group