Comparing 2 files using Syncsort JCL

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Comparing 2 files using Syncsort JCL

Post by goldyroshan » Sat Apr 07, 2012 3:02 am

I want to compare 2 input files [both LRECL=80] (say F1 and F2) and find out which unmatched records are in F1 but not in F2 and the vice versa. I tried using one JCL suggested by Anuj from some other thread, but I am getting JCL error. PFB the JCL and the error:-

Code: Select all

//STEP001  EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1     DD DSN=i/p file 1,DISP=SHR
//IN2     DD DSN=i/p file 2,DISP=SHR
//*T1      DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),
//*          DISP=(MOD,PASS)
//OUTM    DD DSN=o/p file,DISP=(NEW,CATLG,DELETE)
//OUT1    DD DSN=HLQ.ONLY.IN.IN1.OUT,DISP=(NEW,CATLG,DELETE)
//OUT2    DD DSN=HLQ.ONLY.IN.IN2.OUT,DISP=(NEW,CATLG,DELETE)
//TOOLIN  DD *
  COPY FROM(IN1) TO(T1) USING(CTL1)
  COPY FROM(IN2) TO(T1) USING(CTL2)
  SPLICE FROM(T1) TO(OUTM) ON(1,6,CH) WITH(81,1) -
  USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL DD *
   INREC OVERLAY=(80:C'11')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(80:C'22')
 /*
//CTL3CNTL DD *
   OUTFIL FNAMES=OUTM,INCLUDE=(80,2,CH,EQ,C'12'),BUILD=(1,80)
   OUTFIL FNAMES=OUT1,INCLUDE=(80,2,CH,EQ,C'11'),BUILD=(1,80)
   OUTFIL FNAMES=OUT2,INCLUDE=(80,2,CH,EQ,C'22'),BUILD=(1,80)
/*
Error:-
IEF453I NBKETQE1 - JOB FAILED - JCL ERROR - TIME=17.58.19

Can someone please tell me a JCL using SORT that would help me to know which new records (unmatched) are in F1 and not in F2.
N.B. : First 6 bytes is the key of input file.
Logically yours,
:-) GRS :-)

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sat Apr 07, 2012 12:53 pm

Cannot help you with the IBM JCL - not SYNCSORT JCL (they do not do JCL) - as you have not shown WHICH JCL error. At the moment you have no problem with the SYNCSORT control cards as your JCL error stops SYNCSORT from even executing (that is assuming that the JCL error came before or at the sort step shown).
Regards
Nic

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sat Apr 07, 2012 9:28 pm

Have you resolved the JCL error?

There is most likely additional info about the error somewhere in the first 3 sysout datasets of the run (if this is a one-step job, there will probably only be 3 sysout datasets).
Have a good one

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 2:41 am

DikDude wrote:Have you resolved the JCL error?

There is most likely additional info about the error somewhere in the first 3 sysout datasets of the run (if this is a one-step job, there will probably only be 3 sysout datasets).
I was not able to resolve JCL error because it didn't give any error when I did a PREP before submitting the job. Also, the spool is not giving any clear indication about the error since I could not find anything in JESYSMSG. Please help me with this ASAP.
This is the final JCL that I used:-

//UCC11 EXEC UCC11,TYPRUN=='F'
//*
//STEP001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//IN1 DD DSN=i/p file 1,DISP=SHR
//IN2 DD DSN=i/p file 2,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),
// DISP=(MOD,PASS)
//OUTM DD DSN=o/p file,DISP=(NEW,CATLG,DELETE)
//OUT1 DD DSN=HLQ.ONLY.IN.IN1.OUT,DISP=(NEW,CATLG,DELETE)
//OUT2 DD DSN=HLQ.ONLY.IN.IN2.OUT,DISP=(NEW,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUTM) ON(1,6,CH) WITH(81,1) -
USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL DD *
INREC OVERLAY=(80:C'11')
/*
//CTL2CNTL DD *
INREC OVERLAY=(80:C'22')
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUTM,INCLUDE=(80,2,CH,EQ,C'12'),BUILD=(1,80)
OUTFIL FNAMES=OUT1,INCLUDE=(80,2,CH,EQ,C'11'),BUILD=(1,80)
OUTFIL FNAMES=OUT2,INCLUDE=(80,2,CH,EQ,C'22'),BUILD=(1,80)
/*
Logically yours,
:-) GRS :-)

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Mon Apr 09, 2012 3:18 am

Do not depend on PREP. . .

Submit the job for real and see what happens. SomeWhere there IS some indicator of what is wrong.

If this is needed asap, you should be talkiing with your system support people. They can watch the console log as well as the other output and should be able to show you what is causing the problem.

Several of us could probable determine the cause if we had a logon and proper permissions on your system. We don't so the best thing to do is work with your local technical people.
Have a good one

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Mon Apr 09, 2012 3:20 am

As you are using UCC11 in this job, talk with the people who support UCC11. . .

You didn't mention UCC11 in the initial post. . .
Last edited by DikDude on Mon Apr 09, 2012 10:24 pm, edited 1 time in total.
Have a good one

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 3:24 am

DikDude wrote:As you are ucing UCC11 in this job, talk with the people who support UCC11. . .

You didn't mention UCC11 in the initial post. . .
yes, i forgot to paste that portion of JCL in my first post. actually i am not sure whether the system I am working on supports SYNCTOOL, but I read somewhere that since it is a part of DFSORT, it should, but I am not sure. I have used all necessary things in my JCL like SYSOUT DD SYSOUT = * and also my MSGCLASS is the correct one like the one used in my previous test JCLs but not sure why I am not getting a SYSOUT in spool which could let me know the exact reason of this JCL error.
Logically yours,
:-) GRS :-)

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 3:32 am

goldyroshan wrote:
DikDude wrote:As you are ucing UCC11 in this job, talk with the people who support UCC11. . .

You didn't mention UCC11 in the initial post. . .
yes, i forgot to paste that portion of JCL in my first post. actually i am not sure whether the system I am working on supports SYNCTOOL, but I read somewhere that since it is a part of DFSORT, it should, but I am not sure. I have used all necessary things in my JCL like SYSOUT DD SYSOUT = * and also my MSGCLASS is the correct one like the one used in my previous test JCLs but not sure why I am not getting a SYSOUT in spool which could let me know the exact reason of this JCL error.
Even if we are not able to determine the exact reason for JCL error here in my case, still can someone please give me a JCL so as to compare 2 files so that I could find out which (unmatched) records are there in F2 and not in F1 - can someone please provide me with that?
Logically yours,
:-) GRS :-)

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Mon Apr 09, 2012 3:33 am

actually i am not sure whether the system I am working on supports SYNCTOOL, but I read somewhere that since it is a part of DFSORT, it should, but I am not sure
Don't know where you have read this, but i suggest a different source of info. . .

SYNCTOOL is NOT a part of DFSORT - it is a part of Syncsort. ICETOOL is part of DFSORT.

It appears like your problem is related to your environment and you really need help from someone who knows your system to help.

From the dialog, i suspect there is more than one thing that has been misunderstood.
Have a good one

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 3:53 am

yes, i agree. but nevertheless, can I have some other JCL maybe using SORT or FILEAID or IEBGENER which would do the same task. I was able to successfully detect errors in other test JCLs that I have submitted earlier with the same Job card, so I suspect its something because of PGM=SYNCTOOL
Logically yours,
:-) GRS :-)

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Apr 09, 2012 2:22 pm

Do not just look in JESYSMSG - a JCL error can leave its information in any one of JESMSGLG, JESJCL or JESYSMSG so post all 3. Whatever program you use will not cause a JCL error - mis-coding JCL statements, NOT program control statements, will cause a JCL error or coding wrong datasetnames. So please post all 3.

I noticed you have TYPRUN=='F'. Should the '==' be =''?
Regards
Nic

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 6:16 pm

NicC wrote:Do not just look in JESYSMSG - a JCL error can leave its information in any one of JESMSGLG, JESJCL or JESYSMSG so post all 3. Whatever program you use will not cause a JCL error - mis-coding JCL statements, NOT program control statements, will cause a JCL error or coding wrong datasetnames. So please post all 3.

I noticed you have TYPRUN=='F'. Should the '==' be =''?
JESMSGLG:-

--- SUNDAY, 08 APR 2012 ----
$HASP373 NBKETQE1 STARTED - INIT 21 - CLASS R - SYS 2N02
NBUSI05I - REGION SET: 8,192KB BELOW; 1,604MB ABOVE; MEMLIMIT= 300M
IEF403I NBKETQE1 - STARTED - TIME=18.14.10
U11-001 CA-11 - PARM RECEIVED FOR JOB NBKETQE1 - PARM='F'
U11-046 U11RMS JOB NBKETQE1 WILL INTERFACE WITH DBAS SUBSYSTEM CAT7 RELEASE 11.
U11-010 CA-11 - 'F' PROCESSING COMPLETE FOR JOB NBKETQE1
U11-646 U11TRT JOB NBKETQE1 IS BEING TRACKED VIA DBAS SUBSYSTEM CAT7
*IEFACTRT* J=NBKETQE1,S=(001,UCC11 .U11STEP ),RCODE=0000
NBUSI05I - REGION SET: 8,192KB BELOW; 1,604MB ABOVE; MEMLIMIT= 300M
U11-656 JOBNAME=NBKETQE1,STPROC= ,STSTEP= ,AUTO SETUP PARMS
*IEFACTRT* J=NBKETQE1,S=(002, .STEP001 ),NOT EXECUTED
IEF453I NBKETQE1 - JOB FAILED - JCL ERROR - TIME=18.14.10
U11-607 JOBNAME=NBKETQE1,PRODJOB#=0000,TERMINATED UNSUCCESSFULLY
$HASP395 NBKETQE1 ENDED



JESJCL:-

//NBKETQE1 JOB (0021515,BZ),'GOLDIE',MSGCLASS=R,CLASS=R, JOB10227
//* ** FILE COMPARE**
// NOTIFY=&SYSUID,
// USER=NBKETQE,PASSWORD=
IEFC653I SUBSTITUTION JCL - (0021515,BZ),'GOLDIE',MSGCLASS=R,CLASS=R,NOTIFY=NBKE
//UCC11 EXEC UCC11,TYPRUN='F'
XXUCC11RMS PROC TYPRUN=F
XX* CREATED 8/14/06 BY CG
XX*
XX****************************************************************
XX* CA11'S RMS PROCEDURE FOR TEST TSO SUBMITTED JOBS *
XX****************************************************************
XX*
XXU11STEP EXEC PGM=U11RMS,PARM='&TYPRUN',REGION=6M
IEFC653I SUBSTITUTION JCL - PGM=U11RMS,PARM='F',REGION=6M
XX@SSNCAT7 DD DUMMY
XXRMSRPT DD SYSOUT=*
XXSYSUDUMP DD SYSOUT=R
XXABNLIGNR DD DUMMY
//STEP001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//LOGFILE DD SYSOUT=*
//IN1 DD DSN=BCZ.SDOA.HNRI.BXLD4511.G0659.D0405,DISP=SHR
//IN2 DD DSN=BCZ.SDOA.HNRI.BXLD4511.G0658.D0405,DISP=SHR
//T1 DD DSN=&&T1,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(TRK,(5,5))
//OUTM DD DSN=NBKETQE.MATCHED.OUTPUT,DISP=(NEW,CATLG,DELETE)
//OUT1 DD DSN=NBKETQE.ONLY.IN.IN1.OUT,DISP=(NEW,CATLG,DELETE)
//OUT2 DD DSN=NBKETQE.ONLY.IN.IN2.OUT,DISP=(NEW,CATLG,DELETE)
//TOOLIN DD *
//CTL1CNTL DD *
//CTL2CNTL DD *
//CTL3CNTL DD *


JESYSMSG:-

ALLOC. FOR NBKETQE1 U11STEP UCC11
IEF237I DMY ALLOCATED TO @SSNCAT7
IEF237I JES2 ALLOCATED TO RMSRPT
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I DMY ALLOCATED TO ABNLIGNR
U11-001 CA-11 - PARM RECEIVED FOR JOB NBKETQE1 - PARM='F'
U11-046 U11RMS JOB NBKETQE1 WILL INTERFACE WITH DBAS SUBSYSTEM CAT7 RELEASE 11.
U11-010 CA-11 - 'F' PROCESSING COMPLETE FOR JOB NBKETQE1
IEF142I NBKETQE1 U11STEP UCC11 - STEP WAS EXECUTED - COND CODE 0000
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000105.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000106.? SYSOUT
U11-604 ***********************************************************************
U11-605 *
U11-606 CA-11 (ARTS) - AUTOMATED RERUN AND TRACKING SYSTEM - VERSION 11.0
*******************************************************************************
*
* STATISTICS FOR STEP U11STEP PROGRAM U11RMS
*
* STRT DATE 04/08/12 TCB TIME 00.00.00.01 PGM STG BL 368K
* STARTED 18.14.10.30 SRB TIME 00.00.00.00 SYS STG BL 332K
* ENDED 18.14.10.52 SERV UNTS 346 PGM STG AB 8K
* ELAPSED 00.00.00.22 TRAN UNTS 207 SYS STG AB 11668K
*
*******************************************************************************
IEF373I STEP/U11STEP /START 2012099.1814
IEF032I STEP/U11STEP /STOP 2012099.1814
CPU: 0 HR 00 MIN 00.01 SEC SRB: 0 HR 00 MIN 00.00 SEC
VIRT: 368K SYS: 332K EXT: 8K SYS: 11668K
IEF344I NBKETQE1 STEP001 OUTM - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM E
IGD17045I SPACE NOT SPECIFIED FOR ALLOCATION OF DATA SET
NBKETQE.MATCHED.OUTPUT
IEF272I NBKETQE1 STEP001 - STEP WAS NOT EXECUTED.
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000107.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000108.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000109.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000110.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000111.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000112.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000113.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000114.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000115.? SYSOUT
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000101.? SYSIN
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000101.? SYSIN
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000102.? SYSIN
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000103.? SYSIN
IEF285I NBKETQE.NBKETQE1.JOB10227.D0000104.? SYSIN
IGD104I BCZ.SDOA.HNRI.BXLD4511.G0659.D0405 RETAINED, DDNAME=IN1
IGD104I BCZ.SDOA.HNRI.BXLD4511.G0658.D0405 RETAINED, DDNAME=IN2
U11-604 ***********************************************************************
U11-605 *
U11-606 CA-11 (ARTS) - AUTOMATED RERUN AND TRACKING SYSTEM - VERSION 11.0
U11-605 *
U11-652 JOBNAME=NBKETQE1,SYSTEM OPTION SELECTED TO AUTO SETUP
U11-656 JOBNAME=NBKETQE1,STPROC= ,STSTEP= ,AUTO SETUP PARMS
U11-605 *
U11-604 ***********************************************************************
*******************************************************************************
*
* STATISTICS FOR STEP STEP001 PROGRAM SYNCTOOL
*
* STRT DATE 04/08/12 TCB TIME 00.00.00.00 PGM STG BL 0K
* STARTED 18.14.10.52 SRB TIME 00.00.00.00 SYS STG BL 0K
* ENDED 18.14.10.56 SERV UNTS 0 PGM STG AB 0K
* ELAPSED 00.00.00.04 TRAN UNTS 0 SYS STG AB 0K
*
*******************************************************************************
IEF373I STEP/STEP001 /START 2012099.1814
IEF032I STEP/STEP001 /STOP 2012099.1814
CPU: 0 HR 00 MIN 00.00 SEC SRB: 0 HR 00 MIN 00.00 SEC
VIRT: 0K SYS: 0K EXT: 0K SYS: 0K
IEF237I 621F ALLOCATED TO SYS00001
IEF285I SYS12099.T181410.RA000.NBKETQE1.R0100851 KEPT
IEF285I VOL SER NOS= PUB12C.
IGD105I SYS12099.T181410.RA000.NBKETQE1.T1.H01 DELETED, DDNAME=T1
U11-604 ***********************************************************************
U11-605 *
U11-605 *
U11-606 CA-11 (ARTS) - AUTOMATED RERUN AND TRACKING SYSTEM - VERSION 11.0
U11-605 *
U11-607 JOBNAME=NBKETQE1,PRODJOB#=0000,TERMINATED UNSUCCESSFULLY
U11-605 *
U11-604 ***********************************************************************
*******************************************************************************
*
* STATISTICS FOR JOB NBKETQE1
*
* STRT DATE 04/08/12 TCB TIME 00.00.00.01 PGM STG BL 368K
* STARTED 18.14.10.30 SRB TIME 00.00.00.00 SYS STG BL 332K
* ENDED 18.14.10.58 SERV UNTS 346 PGM STG AB 8K
* ELAPSED 00.00.00.28 TRAN UNTS 207 SYS STG AB 11668K
*
*******************************************************************************
IEF375I JOB/NBKETQE1/START 2012099.1814
IEF033I JOB/NBKETQE1/STOP 2012099.1814
CPU: 0 HR 00 MIN 00.01 SEC SRB: 0 HR 00 MIN 00.00 SEC
******************************** BOTTOM OF DATA ********************************
Logically yours,
:-) GRS :-)

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Apr 09, 2012 7:23 pm

Try reading your messages:
IEF344I NBKETQE1 STEP001 OUTM - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM E
IGD17045I SPACE NOT SPECIFIED FOR ALLOCATION OF DATA SET
Regards
Nic

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 7:45 pm

NicC wrote:Try reading your messages:
IEF344I NBKETQE1 STEP001 OUTM - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM E
IGD17045I SPACE NOT SPECIFIED FOR ALLOCATION OF DATA SET
Well, my bad!!!
I corrected that & it worked perfect.
Thanks a lot NicC for devoting time in reading my posts. Really appreciate it.
Logically yours,
:-) GRS :-)

goldyroshan
Active Member
Posts: 67
Joined: Thu Apr 05, 2012 1:29 am
Location: WI, USA

Post by goldyroshan » Mon Apr 09, 2012 8:55 pm

goldyroshan wrote:
NicC wrote:Try reading your messages:
IEF344I NBKETQE1 STEP001 OUTM - ALLOCATION FAILED DUE TO DATA FACILITY SYSTEM E
IGD17045I SPACE NOT SPECIFIED FOR ALLOCATION OF DATA SET
Well, my bad!!!
I corrected that & it worked perfect.
Thanks a lot NicC for devoting time in reading my posts. Really appreciate it.
@NicC - theres one small problem still pending. I am not correctly getting OUTM file populated. The other 2 output files are correctly populated, but somehow the OUTM is empty. I have correctly populated data in input files, so that is all ok. Please help.
Logically yours,
:-) GRS :-)

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others