|
|
| Author |
Message |
Bharath Nadipally
New User
Joined: 24 Jun 2008 Posts: 20 Location: Hyderabad
|
|
|
|
Alissa,
| Alissa Margulies wrote: |
| ... Or, do you simply want to pair Record1 from File1 to Record1 of File2, and Record2 from File1 with Record2 of File2, etc... |
Yes. I just want to pair record1 from file1 to record2 of file2, etc.... |
|
| Back to top |
|
 |
References
|
|
 |
Bharath Nadipally
New User
Joined: 24 Jun 2008 Posts: 20 Location: Hyderabad
|
|
|
|
Alissa,
| Quote: |
... Or, do you simply want to pair Record1 from File1 to Record1 of File2, and Record2 from File1 with Record2 of File2, etc...
|
Yes. I want to pair Record1 from File1 to Recor1 of File2, etc.... |
|
| Back to top |
|
 |
arcvns
Senior Member
Joined: 17 Oct 2006 Posts: 707 Location: Chennai, India
|
|
|
|
Bharat,
Are both the files having equal number of records. If not, what is your expected output in that case?
Thanks,
Arun |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 244 Location: USA
|
|
|
|
Bharath,
This SyncSort job should produce the desired results:
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
FIELD1
FIELD2
FIELD3
//SORTOUT DD DSN=&&TEMP1,DISP=(NEW,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:SEQNUM,4,ZD,1,6)
//*****************************************
//STEP2 EXEC PGM=SORT
//SORTIN DD *
FIELD4
FIELD5
FIELD6
//SORTOUT DD DSN=&&TEMP2,DISP=(NEW,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:SEQNUM,4,ZD,1,6)
//*****************************************
//STEP3 EXEC PGM=SORT
//SORTJNF1 DD DSN=&&TEMP1,DISP=(OLD,DELETE)
//SORTJNF2 DD DSN=&&TEMP2,DISP=(OLD,DELETE)
//SORTOUT DD DSN=FINAL.OUTPUT
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,4,A)
JOINKEYS FILES=F2,FIELDS=(1,4,A)
REFORMAT FIELDS=(F1:5,6,F2:5,6)
SORT FIELDS=COPY
OUTREC FIELDS=(1,6,1X,7,6)
/* |
|
|
| Back to top |
|
 |
Bharath Nadipally
New User
Joined: 24 Jun 2008 Posts: 20 Location: Hyderabad
|
|
|
|
Alissa,
Thank you very much. |
|
| Back to top |
|
 |
|
|
|