Page 1 of 1

Syncsort get unmatched records & Merging of matching records

PostPosted: Thu Jun 27, 2013 12:28 pm
by SLEEPLESS
I need a sortcard that will take in 2 input files and give me 3 output files-
output1 - merge record of File 2 in the middle of File 1 record, if matching
output2 - unmatching records of File1
output3 - unmatching records of File2

so the sample output will look like-
File 1-------------File2-File1 **** actual output starts below-
1111111111111 AAAA X
5555555555555 IUYT Z
8888888888888 HRRR Y

I ran a sample sort card that I picked from this forum but it only gives matching(from File1) & unmatching records in two files.
//STEP1 EXEC PGM=SORT
//SORTJNF1 DD *
1111111111111 X
3333333333333 Y
5555555555555 Z
7777777777777 X
8888888888888 Y
//SORTJNF2 DD *
2222222222222 AAAA GGGG
1111111111111 TRRD HDGF
8888888888888 HRRR REDS
9999999999999 JGTF FDES
5555555555555 IUYT WESD
//SORTOF01 DD DSN=MATCHED.RECORDS,DISP=...
//SORTOF02 DD DSN=UNMATCHD.RECORDS,DISP=...
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,15,A)
JOINKEYS FILE=F2,FIELDS=(1,15,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,65,F2:1,1)
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(66,1,CH,NE,X'40'),BUILD=(1,65)
OUTFIL FILES=02,INCLUDE=(66,1,CH,EQ,X'40'),BUILD=(1,65)
/*

could somebody help plz its very urgent! Thanks

Re: Syncsort get unmatched records & Merging of matching rec

PostPosted: Sat Jun 29, 2013 12:12 am
by dick scherrer
Hello and welcome to the froum,

If you are willing to pay the going rate for "urgent" questions, fine. Several here will work for pay. . .

How/why did you decide to use this:
JOIN UNPAIRED,F1
?

Suggest you not just grab "something" and use it without understanding what it really will do.

Read about UNPAIRED and come back if you do not understand what is in the manual.