I want to compare 2 sorted files on a particular field and write the unmatched records of the first file in the 3rd output file. how can I do it using jcl sort card and using join keys and reformat fields?
The sample files are
File A
123 rohan mumbai
234 sanu chennai
456 aaaa delhi
File B
123 d23 1234.60
345 d45 1456.90
456 d67 3456.00
output file
234 sanu chennai
Jcl sort using join keys and reformat fields
-
- Posts: 110
- Joined: Thu Dec 27, 2007 5:18 pm
- Skillset: Known little stuffs to answer a few queries!!
- Referer: Google
- Contact:
Re: Jcl sort using join keys and reformat fields
Raj,
Here you go!!
PS: I do NOT have SYNCSORT in my shop, so this is an untested version. Hope this works.
Let me know if you have any questions.
Arun.
Here you go!!
Code: Select all
//STEP1 EXEC PGM=SYNCSORT
//SORTJNF1 DD *
123 ROHAN MUMBAI
234 SANU CHENNAI
456 AAAA DELHI
//SORTJNF2 DD *
123 D23 1234.60
345 D45 1456.90
456 D67 3456.00
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F2,FIELDS=(1,3,A)
JOINKEYS FILE=F1,FIELDS=(1,3,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,80)
SORT FIELDS=COPY
/*
PS: I do NOT have SYNCSORT in my shop, so this is an untested version. Hope this works.
Let me know if you have any questions.
Arun.