Page 1 of 1

Compare 2 PDS Members for Unmatched job names

PostPosted: Sun Mar 07, 2010 7:44 pm
by rayngerfan
I have 2 members in a PDS. 1 member contains 100 job names & the 2 member contains 90 job names. The job names start in column 1 - 8.

I'm trying to run a job that would identify which job names are in member 1 (100) that aren't in member 2 (90).

I'm not sure if SORT or SYNCTOOL has a MATCH parameter that would copy the unmatched job names to a flat file or to a PDS member.

Any help is greatly appreciated.

//STEP1    EXEC PGM=SYNCTOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN   DD DSN=TBRIRAN.CARDLIB(PR4MEMBS),DISP=SHR
//      DD DSN=TBRIRAN.CARDLIB(PR7MEMBS),DISP=SHR
//SORTXSUM  DD DSN=TBRIRAN.CARDLIB(PR7MEMBX),DISP=SHR
//OUT  DD DSN=TBRIRAN.GDG.FILE1,DISP=SHR
//TOOLIN   DD *
  SELECT FROM(IN) TO(OUT) ON(1,8,CH) FIRST (SORTXSUM)
/*

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Sun Mar 07, 2010 10:32 pm
by MrSpock
I would do it this way:

Copy PDS1 and add an identifier to you know which duplicates are in PDS1.
Copy PDS2 as it.

Use the SELECT with NODUPS to find the entries that are not duplicated (they may be in PDS1 or they may be in PDS2.

Then, copy only those non-duplicate entries that have the identifier that you placed to kark them as belonging to PDS1 only.

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Mon Mar 08, 2010 10:17 pm
by Alissa Margulies
Here is a SyncSort for z/OS job that will provide you with the unmatched records from the first file:
//SORT1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTJNF1 DD DSN=TBRIRAN.CARDLIB(PR4MEMBS),DISP=SHR
//SORTJFN2 DD DSN=TBRIRAN.CARDLIB(PR7MEMBS),DISP=SHR
//SORTOUT  DD DSN=...
//SYSIN    DD *
  JOINKEYS FILE=F1,FIELDS=(1,8,A)
  JOINKEYS FILE=F2,FIELDS=(1,8,A)
  JOIN UNPAIRED,F1,ONLY
  SORT FIELDS=COPY
/*

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Tue Mar 09, 2010 5:42 pm
by rayngerfan
Hi Alissa

Thanks for the information. The job worked, but what parameters would I change if I wanted to match duplicate jobs names that are in both PDS members in 1 file and put the unmatched job names in another file.

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Tue Mar 09, 2010 9:08 pm
by Alissa Margulies
Give this a try and let me know if you get the desired results:
//SORT1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTJNF1 DD DSN=TBRIRAN.CARDLIB(PR4MEMBS),DISP=SHR
//SORTJFN2 DD DSN=TBRIRAN.CARDLIB(PR7MEMBS),DISP=SHR
//SORTOF01 DD DSN=MATCHED.RECORDS,...
//SORTOF02 DD DSN=UNIQUE.F1.RECORDS,...
//SYSIN    DD *
  JOINKEYS FILE=F1,FIELDS=(1,8,A)
  JOINKEYS FILE=F2,FIELDS=(1,8,A)
  JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,8,F2:1,8)
  SORT FIELDS=COPY
  OUTFIL FILES=01,INCLUDE=(9,8,CH,NE,C' '),BUILD=(1,8)
  OUTFIL FILES=02,SAVE,BUILD=(1,8)
/*

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Wed Mar 10, 2010 12:47 am
by rayngerfan
Hi Alissa

I tried the below JCL and my job recieved a U0016 abend. I looked for details about the abend in the sysout, but no information was provided.

IEF450I TBRIRANR SORT1 - ABEND=S000 U0016 REASON=00000000


-24K BYTES OF EMERGENCY SPACE ALLOCATED
-JOINKEYS REFORMAT RECORD LENGTH= 16, TYPE = F
-SORTOF01 : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
-SORTOF02 : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
-SORTOF01 HAS INCOMPATIBLE LRECL
-SORTOF02 HAS INCOMPATIBLE LRECL
-SYNCSMF CALLED BY SYNCSORT; RC=0000
-JNF1 STATISTICS
-13,940K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUEST
- 0 BYTES RESERVE REQUESTED, 996K BYTES USED
-SORTJNF1 : RECFM=FB ; LRECL= 80; BLKSIZE= 400
-JNF2 STATISTICS
-13,940K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUEST
- 0 BYTES RESERVE REQUESTED, 996K BYTES USED
-SORTJNF2 : RECFM=FB ; LRECL= 80; BLKSIZE= 400

//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=TBRIRAN.CARDLIB(PR4MEMS),DISP=SHR
//SORTJNF2 DD DSN=TBRIRAN.CARDLIB(PR7MEMS),DISP=SHR
//SORTOF01 DD DSN=TBRIRAN.MATCHED.RECORDS,DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80),UNIT=TEST,SPACE=(CYL,(1,1),RLSE)
//SORTOF02 DD DSN=TBRIRAN.UNIQUE.F1.RECORDS,DISP=(,CATLG,DELETE
// DCB=(LRECL=80,RECFM=FB),UNIT=TEST,SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,8,F2:1,8)
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(9,8,CH,NE,C' '),BUILD=(1,8)
OUTFIL FILES=02,SAVE,BUILD=(1,8)
/*

SYNCSORT FOR Z/OS 1.3.2.0R U.S. PATENTS: 4210961, 5117495 (C) 2007
AUTOMATIC DATA PROCESSING DATA CENTERS z
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 4DCE2, MODEL 2097 708
SYSIN :
JOINKEYS FILE=F1,FIELDS=(1,8,A)
JOINKEYS FILE=F2,FIELDS=(1,8,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,8,F2:1,8)
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(9,8,CH,NE,C' '),BUILD=(1,8)
OUTFIL FILES=02,SAVE,BUILD=(1,8)

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Wed Mar 10, 2010 2:01 am
by Alissa Margulies
Without looking at the complete job listing, I can only assume that the abend is caused by the conflicting LRECLs between the OUTFIL BUILD statement and the LRECL you hard-coded in the JCL for the SORTOFxx DDs. If you want an 80 byte record produced, then change your OUTFIL statements as follows:
OUTFIL FILES=01,INCLUDE=(9,8,CH,NE,C' '),BUILD=(1,8,80:X)
OUTFIL FILES=02,SAVE,BUILD=(1,8,80:X)

Give that a try and let me know if you continue to encounter a problem.

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Wed Mar 10, 2010 2:37 am
by rayngerfan
Hi Alissa

Changing the build parameter to 80 bytes worked. Thanks for all your help.

Re: Compare 2 PDS Members for Unmatched job names

PostPosted: Wed Mar 10, 2010 9:28 pm
by Alissa Margulies
Glad it worked. Thanks for letting us know.