chandu Beginner

Joined: 18 Dec 2003 Posts: 15 Topics: 6
|
Posted: Sat Dec 27, 2003 8:27 am Post subject: creating two different records out of one record with change |
|
|
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 |
|
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12383 Topics: 75 Location: San Jose
|
Posted: Sat Dec 27, 2003 8:57 am Post subject: |
|
|
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 |
|