JOINKEYS - In SORT - Paired and unpaired



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JOINKEYS - In SORT - Paired and unpaired

Postby SORT_QUEST » Wed Jun 16, 2021 10:38 am

My objective is basically to compare 2 VBS files and determine the fields that are different between them. Either the BOTH or the SORTOUT output should show the entire record length from each of the files 1 below the other so it helps in compare.
With my SORT control, my SORTOUT shows like this:

1st field 1st field of file2 this is the difference
__ __ |
B12 ABC 789 MDX.... 12 ABC 789 MDY....
|
Indicator to say in both files

My goal is for SORTOUT to show like this:
B12 ABC 789 MDX....
12 ABC 789 MDY.... --> With or without 'B', but basically one following the other in alignment

I have 2 files , say OLD FILE (F1) & NEW FILE(F2). Both files are VBS & 3660 in length - with RDW it will be 3664. Am using JOINKEYS to help with this compare as shown below. The F1ONLY & F2ONLY work right but my paired records appear in the SORTOUT. The way it is coded here results in the F1 & F2 records appear one following the other when what is desired is they appear as 2 separate records, so I can easily validate the unmatched fields of the same record.

//CMPMTCH EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=CMP.TEST.BKUP.SRT1,
// DISP=SHR
//SORTJNF2 DD DSN=CMP.TEST.BKUP.SRT2,
// DISP=SHR
//F1ONLY DD DSN=CMP.TST2.F1ONLY0,DISP=(NEW,CATLG,DELETE),
// RECFM=VBS,LRECL=3664,SPACE=(CYL,(1000,1000),RLSE)
//F2ONLY DD DSN=CMP.TST2.F2ONLY0,DISP=(NEW,CATLG,DELETE),
// RECFM=VBS,LRECL=3664,SPACE=(CYL,(1000,1000),RLSE)
//BOTH DD DSN=CMP.TST2.BOTH0,DISP=(NEW,CATLG,DELETE),
// RECFM=VBS,LRECL=3664,SPACE=(CYL,(1000,1000),RLSE)
//SORTOUT DD DSN=CMP.TST2.BOTH1,DISP=(NEW,CATLG,DELETE),
// RECFM=VBS,LRECL=3664,SPACE=(CYL,(1000,1000),RLSE)
//SYSIN DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(42,17,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(42,17,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,4,?,F1:5,F2:5)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=F1ONLY,INCLUDE=(5,1,CH,EQ,C'1'),
BUILD=(1,4,5,3660),VLTRIM=C' '
OUTFIL FNAMES=F2ONLY,INCLUDE=(5,1,CH,EQ,C'2'),
BUILD=(1,4,5,3660),VLTRIM=C' '
OUTFIL FNAMES=BOTH,INCLUDE=(5,1,CH,EQ,C'B'),
BUILD=(1,4,5,3660),VLTRIM=C' '
/*
//JNF1CNTL DD *
INREC IFTHEN=(WHEN=(1,2,BI,LE,3664),OVERLAY(3664:X))
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=(1,2,BI,LE,3664),OVERLAY(3664:X))
SORT_QUEST
 
Posts: 1
Joined: Wed Jun 16, 2021 10:23 am
Has thanked: 0 time
Been thanked: 0 time

Re: JOINKEYS - In SORT - Paired and unpaired

Postby sergeyken » Wed Jun 16, 2021 5:13 pm

Use code tags if you want somebody to pay attention to your code.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 409
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post