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 

creating two different records out of one record with change

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


Joined: 18 Dec 2003
Posts: 15
Topics: 6

PostPosted: Sat Dec 27, 2003 8:27 am    Post subject: creating two different records out of one record with change Reply with quote

Hi

I have one input file (VSAM) which has a code say 2 (in hex) in the positon 1-2 now i have to create two records out of this record and keep it in one file (VSAM), the two records will have the same data as the original file barring the above 2 which will be now be 3 and 4.
Assume this is a record in the first file
2 AAAAAAAAAAAABBBBBBBBB

The output should be
3 AAAAAAAAAAAABBBBBBBBB
4 AAAAAAAAAAAABBBBBBBBB

I dont want to use a program for the same, Can it be done through Syncsort, Please help.

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Dec 27, 2003 8:57 am    Post subject: Reply with quote

Chandu,

The following JCl will give you desired results.I assumed that the input file Lrecl is 80 and of recfm FB.A brief explanation of the job. we are adding a constant value of 1 and 2 to the existing record and spliting the record into two records.


Code:

//STEP0100  EXEC  PGM=SORT                         
//SYSOUT    DD SYSOUT=*                             
//SORTIN    DD *                                   
 2 AAAAAAAAAAAABBBBBBBBB                           
//SORTOUT   DD DSN=YOUR OUTPUT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//SYSIN     DD *                                 
  SORT FIELDS=COPY                                   
  OUTFIL OUTREC=(+1,ADD,1,2,ZD,EDIT=(IT),3,78,/,     
                 +2,ADD,1,2,ZD,EDIT=(IT),3,78)       
/*


Hope this helps...

cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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