JCL to compare multiple datasets in one job



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

JCL to compare multiple datasets in one job

Postby funkysnake » Wed Apr 29, 2020 9:05 pm

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 **********************
funkysnake
 
Posts: 2
Joined: Wed Apr 29, 2020 8:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to compare multiple datasets in one job

 

Re: JCL to compare multiple datasets in one job

Postby prino » Wed Apr 29, 2020 11:26 pm

Your JCL doesn't even work for a two datasets.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 606
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 27 times

Re: JCL to compare multiple datasets in one job

Postby funkysnake » Wed Apr 29, 2020 11:38 pm

Yes i know that, i want to know whats missing, to make this work.
PS: I am a beginner.
funkysnake
 
Posts: 2
Joined: Wed Apr 29, 2020 8:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to compare multiple datasets in one job

Postby Robert Sample » Wed Apr 29, 2020 11:59 pm

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.
Robert Sample
Global moderator
 
Posts: 3655
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 270 times

Re: JCL to compare multiple datasets in one job

Postby willy jensen » Thu Apr 30, 2020 2:29 pm

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.
willy jensen
 
Posts: 307
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 42 times

Re: JCL to compare multiple datasets in one job

Postby Terry Heinze » Thu Apr 30, 2020 7:01 pm

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
//
.... Terry
Terry Heinze
 
Posts: 232
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 11 times
Been thanked: 11 times

Re: JCL to compare multiple datasets in one job

Postby prino » Thu Apr 30, 2020 9:48 pm

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.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 606
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 27 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post