Page 1 of 1

Join two sort step into one

PostPosted: Thu Mar 21, 2013 7:33 pm
by zhinghur
Hi All,

Can you please help me to join the two steps and make it one ?

I am getting error with Reformat parameter while trying to make it one.

//DIFF EXEC PGM=SORT
//SORTJNF1 DD DSN=File1,DISP=SHR
//SORTJNF2 DD DSN=File2,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SORTOUT DD DSN=file3,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,11,A)
JOINKEYS FILE=F2,FIELDS=(1,11,A)
JOIN UNPAIRED,ONLY
REFORMAT FIELDS=(F1:1,80)
OPTION COPY
/*

//FORMAT EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=File3,DISP=SHR
//SORTOUT DD DSN=File4,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,11,C' YES ',80:X)
/*

Thanks,

Re: Join two sort step into one

PostPosted: Fri Mar 22, 2013 12:57 am
by NicC
Surely you know how to use the code tags by now to make your data more presentable?

Re: Join two sort step into one

PostPosted: Fri Mar 22, 2013 2:32 am
by skolusu
zhinghur,

Are you getting the right results? You have JOIN UNPAIRED,ONLY without file name and it produces all unmatched records from both files. However your REFORMAT statement is only building the first 80 bytes from FIle1. Any unmatched record from File2 will have spaces. Is that what you really want?