Page 1 of 1

JCL to compare multiple datasets in one job

PostPosted: Wed Apr 29, 2020 9:05 pm
by funkysnake
Hi, I need a JCL to do a comparision between 2 datasets and give me a output with the comparision results ; however i have 20+ comparisions to do .. and i want to do them in one job .. i have this (below) to start with, how do i make it work for a bulk file compare

000100 //FUNKYSNAKE JOB (100),'COMPARE0',CLASS=6,MSGCLASS=X,              
 000200 // NOTIFY=&SYSUID                                                
 000300 //*                                                              
 000400 //*                                                              
 000500 //*                                                              
 000600 //SUPERC  EXEC PGM=ISRSUPC,                                      
 000700 //            PARM=(DELTAL,LINECMP,                              
 000800 //            ' SEQ',                                            
 000900 //            '')                                                
 001000 //NEWDD  DD DSN=FILE1.DATASET                    
 001100 //          DISP=SHR                                              
 001200 //OLDDD  DD DSN=FILE2.DATASET,              
 001300 //          DISP=SHR                                              
 001400 //OUTDD  DD SYSOUT=FILE3.COMPARE.TEST.RESULTS                  
 001500 **************************** BOTTOM OF DATA **********************

Re: JCL to compare multiple datasets in one job

PostPosted: Wed Apr 29, 2020 11:26 pm
by prino
Your JCL doesn't even work for a two datasets.

Re: JCL to compare multiple datasets in one job

PostPosted: Wed Apr 29, 2020 11:38 pm
by funkysnake
Yes i know that, i want to know whats missing, to make this work.
PS: I am a beginner.

Re: JCL to compare multiple datasets in one job

PostPosted: Wed Apr 29, 2020 11:59 pm
by Robert Sample
There are vendor tools available to compare multiple datasets (FileAid and Comparex come to mind but I'm sure there are more) but if you don't have these tools they cost money. As far as I am aware, there are no multiple dataset comparison tools available in base z/OS. So your basic solution, if you don't have access to a vendor tool, will be to repeat the ISRSUPC JCL one time for each pair of datasets to compare, updating the old and new appropriately. As long as you have 255 or fewer comparisons to do, this is a perfectly fine solution. If you have 256 or more comparisons to do, you'll need multiple jobs.

Re: JCL to compare multiple datasets in one job

PostPosted: Thu Apr 30, 2020 2:29 pm
by willy jensen
You can make the job somewhat smaller by using an instream procedure like this:

//SC    PROC D1=,D2=,RD=                          
//SUPERC  EXEC PGM=ISRSUPC,PARM=(DELTAL,LINECMP,'SEQ','')                  
//NEWDD  DD DISP=SHR,DSN=&D1                      
//OLDDD  DD DISP=SHR,DSN=&D2                      
//OUTDD  DD DISP=SHR,DSN=&RD                      
//      PEND                                      
//*                                                
//C1    EXEC SC,D1=FILE1.DATASET,D2=FILE2.DATASET,
//      RD=REPORT1.DATASET

More complicated, use ISPF skeleton services to build the job.

Re: JCL to compare multiple datasets in one job

PostPosted: Thu Apr 30, 2020 7:01 pm
by Terry Heinze
Another example, somewhat longer than Willy's:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
//SYSUIDT1 JOB (AAB00,9252),'XXXXX XXXXXX -- XXXX',
//             CLASS=A,
//             MSGCLASS=H,
//             NOTIFY=&SYSUID
//*  I AM &SYSUID.AAA.CNTL(TSTSTMT9)
//*  RUN THIS JOB ON DAY4 AFTER THE 7 HLQ.ES.GROUPE* FILES
//*  HAVE BEEN CREATED.                   +--------------------------+
//         SET PR1PP=16  PAY PERIOD  <----¦ CHANGE BEFORE SUBMITTING ¦
//         SET CY1=17    2-DIGIT YEAR     +--------------------------+
//*  THE FOLLOWING PROC WILL BE EXECUTED 7 TIMES,
//*  ONCE FOR EACH ES GROUP.
//*
//BACKUP  PROC GRP=      ES GROUP
//DELETE  EXEC PGM=IEFBR14
//SORTOUT  DD  DSN=XXXXXXX.ES.GROUP&GRP..PP&PR1PP.&CY1..&SYSUID,
//             DISP=(MOD,DELETE,DELETE),
//             SPACE=(TRK,0)
//COPY    EXEC PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=HLQ.ES.GROUP&GRP,
//             DISP=SHR
//SORTOUT  DD  DSN=HLQ.ES.GROUP&GRP..PP&PR1PP.&CY1..&SYSUID,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(500,500),RLSE),
//             UNIT=(DISK,10)
//SYSIN    DD  *
       OPTION  COPY
//        PEND
//*
//BCKUPE1 EXEC BACKUP,GRP=E1  BACK UP HLQ.ES.GROUPE1
//BCKUPE2 EXEC BACKUP,GRP=E2  BACK UP HLQ.ES.GROUPE2
//BCKUPE3 EXEC BACKUP,GRP=E3  BACK UP HLQ.ES.GROUPE3
//BCKUPE4 EXEC BACKUP,GRP=E4  BACK UP HLQ.ES.GROUPE4
//BCKUPE5 EXEC BACKUP,GRP=E5  BACK UP HLQ.ES.GROUPE5
//BCKUPE6 EXEC BACKUP,GRP=E6  BACK UP HLQ.ES.GROUPE6
//BCKUPE7 EXEC BACKUP,GRP=E7  BACK UP HLQ.ES.GROUPE7
//

Re: JCL to compare multiple datasets in one job

PostPosted: Thu Apr 30, 2020 9:48 pm
by prino
Use REXX in batch, and you can make things as complex as you want.

I've got a regression testing job that had to be split into three different jobs due to the fact that as a single job it would have contained more than 600 steps. The converted-to-REXX job contains just one step, and I can loop at will in it. Put your datasets-to-be-compared into two data members, read them into two stems, and you can loop through the lot.