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))
JOINKEYS - In SORT - Paired and unpaired
-
- Posts: 1
- Joined: Wed Jun 16, 2021 10:23 am
- Skillset: Mainframe
- Referer: Google
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: JOINKEYS - In SORT - Paired and unpaired
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.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 1
- 1250
-
by sergeyken
View the latest post
Tue Nov 08, 2022 7:22 pm
-
-
COBOL SORT - How to sort entire file first & sort by Key
by k_ekam » Thu Dec 01, 2022 12:58 pm » in IBM Cobol - 3
- 1557
-
by Robert Sample
View the latest post
Wed Dec 07, 2022 7:32 am
-
-
- 1
- 1779
-
by prino
View the latest post
Tue Jul 02, 2024 2:23 pm
-
- 2
- 1451
-
by willy jensen
View the latest post
Fri Aug 13, 2021 8:11 pm
-
-
How to sum a decimal value using sort
by hkaur7087 » Thu Aug 05, 2021 2:19 pm » in DFSORT/ICETOOL/ICEGENER - 4
- 2357
-
by sergeyken
View the latest post
Thu Aug 05, 2021 7:48 pm
-