comapare file1 with 12 file then copy the matched records one file and unmatch records other files using jcl - jcl

could you please help to get results for below requirement
the file 1 having only 18 fixed length data to compare with file 2
if any matching records
then copy the complete matching record from file 2 to output1 and
the non-matching records from file 1 and file 2 to other output2
input1 file length 18
input2 file length 503
i have joined 12 files into single file like this
STEP001 EXEC PGM=SORT
SORTJNF1 DD DSN=XXX.Q.KR0Z2R99.XXXX.ISA.OUP(0),DISP=SHR
SORTJNF2 DD DSN=xxx.P.K0101N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3211N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K2912N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K0618N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3720N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4731N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K0242N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4451N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K1256N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K4560N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K1961N00.xxxx11P1.xxxxXTO(0),DISP=SHR
DD DSN=xxx.P.K3290N00.xxxx11P1.xxxxXTO(0),DISP=SHR
SORTOUT DD DSN=XXX.Q.KR0Z2R99.XXX.MAT.OUP(+1),
DISP=(NEW,CATLG,DELETE),
DCB=(LRECL=261,BLKSIZE=0,RECFM=FB),
SPACE=(CYL,(20,10),RLSE)
SYSPRINT DD SYSOUT=*
SYSOUT DD SYSOUT=*
SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,18,A)
JOINKEYS FILE=F2,FIELDS=(1,18,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F2:1,258,F2:264,1,F2:334,2)
SORT FIELDS=COPY
here just i tried to copy the only matching records but the out file got complete records from input2

Related

Steps involved to execute a COBOL program static calling a COBOL/DB2 subprogram

I have a main program which is purely COBOL, and a COBOL-DB2 subprogram. I compiled both using a cobol-db2 compiler, return code is 4 (informational warning only). Then, I bind them both. Now I'm trying to execute the main program using a JCL DB2, however, it doesn't seem to be able to call the subprogram or even execute the run step.
This is my JCL DB2 to run the mainprog calling the subprog:
//GO EXEC PGM=IKJEFT01,DYNAMNBR=20,REGION=4M,COND=(4,LT)
//STEPLIB DD DSN=DSN910.DB9G.RUNLIB.LOAD,
// DISP=SHR
// DD DISP=SHR,DSN=DSN910.DB9G.SDSNEXIT
// DD DISP=SHR,DSN=DSN910.SDSNLOAD
// DD DISP=SHR,DSN=ISP.SISPLOAD
// DD DISP=SHR,DSN=GDDM.SADMMOD
//SYSOUT DD SYSOUT=*
//SYUDUMP DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//TRANFILE DD DSN=PROJECT.ABC.TRANKSDS,DISP=SHR
//MGMTREPT DD DSN=PROJECT.ABC.MGMTREPT,
// UNIT=SYSDA,DISP=(NEW,CATLG),
// SPACE=(32,(3,3)),
// DCB=(RECFM=FB,LRECL=81,BLKSIZE=81)
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB9G)
RUN PROGRAM(ABCREPRT) PLAN(DSNTIA91)
END
/*
Then this is the SDSF of the JCL, return code = 0:
NP DDNAME StepName ProcStep DSID
JESMSGLG JES2 2
JESJCL JES2 3
JESYSMSG JES2 4
Shouldn't GO stepname appear as well if it's a successful execution?
I would at least expect a READY message on //SYSTSPRT if that step did start. So, yes there should be an entry for SYSTSPRT in that list. Did you look at the OUTPUT queue in SDSF to see if some output of your job went to this queue instead of the HOLD queue?
You could replace the DSN ... END sequence in //SYSTSIN with some TSO command, say LISTA and see if this produces some output.

How to get text in my new member using JCL

I have to make a new member in a JCL. This isn't a problem:
My code:
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
//SYSUT2 DD DISP=(NEW,KEEP),UNIT=SYSALLDA,DSN=name.JCL4(MEMBER),
SPACE=(CYL,(1,1,45)),
VOL=SER=DMTU01
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
/*
But I want that my MEMBER1 contains text.
So when I go in JCL4 and I press an e (edit) before MEMBER, I want to see some text like 'Hallo'. Can someone help me to explain how to do this?
If you are creating a new member in an existing JCL dataset, Try:
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
Hello
/*
//SYSUT2 DD DSN=name.JCL4(MEMBER),DISP=(SHR,KEEP)
//SYSIN DD DUMMY
/*
The Disp refers to the dataset and not the member. so if the dataset already exists, you do not need to create it !!.
If you want create a new JCL dataset and a member at the same time,
the JCL should be like (where you catlg the dataset)
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
Hello
/*
//SYSUT2 DD DSN=name.JCL4(MEMBER),DISP=(NEW,CATLG),
// UNIT=SYSALLDA, should this be sysda ???
// SPACE=(CYL,(1,1,45)),
// VOL=SER=DMTU01
//SYSIN DD DUMMY
/*

UNIDENTIFIED OPERATION FIELD JCL

I am trying to understand where I am going wrong in my JCL file.
Here is my code as follows:
//MULTG013 JOB 1,NOTIFY=&SYSUID
//STEP1 EXEC PGM=ICEGENER
//SYSUT1 DD DSN=UNTG013.DATAIN(AUTODATA),DISP=SHR
//SYSUT2 DD DSN=UNTG013.DATAOUT(MULTIOUT),DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE UNTG013.DATAIN(AUTONEW)
/*
//STEP3 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//OLDINV DD DSN=UNTG013.DATAIN(AUTODATA),DISP=SHR
//NEWINV DD DSN=UNTG013.DATAIN(AUTONEW),DISP=SHR
//SYSIN DD *
REPRO INFILE(OLDINV) OUTFILE(NEWINV)
/*
//STEP4 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//STUFF DD DSN=UNTG013.DATAIN(AUTONEW),DISP=SHR
//SYSIN DD *
PRINT INFILE(STUFF) CHAR
/*
//STEP5 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
RENAME 'UNTG013.DATAIN(AUTONEW)' 'UNTG013.DATAIN(ITDSDATA)'
/*
//STEP6 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//STUFF DD DSN=UNTG013.DATAIN(ITDSDATA),DISP=SHR
//SYSIN DD *
PRINT INFILE(STUFF) CHAR
/*
//STEP7 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE UNTG013.DATAIN(ITDSDATA)
/*
//
The error I am getting on the SYS Z is: IEFC605I UNIDENTIFIED OPERATION FIELD, lines 17 & 25.
Not quite sure how it is incorrect. Thanks
OK. Here is the message from spool:
SDSF OUTPUT DISPLAY MULTG013 JOB02122 DSID 4 LINE NOT PAGE MODE DATA
COMMAND INPUT ===> SCROLL ===> PAGE
***************** TOP OF DATA ******************
STMT NO. MESSAGE
17 IEFC605I UNIDENTIFIED OPERATION FIELD
25 IEFC605I UNIDENTIFIED OPERATION FIELD
**************** BOTTOM OF DATA ****************
also just found this as well.
SDSF OUTPUT DISPLAY MULTG013 JOB02122 DSID 2 LINE NOT PAGE MODE DATA
COMMAND INPUT ===> SCROLL ===> PAGE
***************** TOP OF DATA ******************
J E S 2 J O B L O G -- S Y S T E M S 0 W 1 -- N O D E
17.59.22 JOB02122 ---- FRIDAY, 28 MAR 2014 ----
17.59.22 JOB02122 IRR010I USERID UNTG013 IS ASSIGNED TO THIS JOB.
17.59.22 JOB02122 IEFC452I MULTG013 - JOB NOT RUN - JCL ERROR 415
------ JES2 JOB STATISTICS ------
41 CARDS READ
45 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
2 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME
**************** BOTTOM OF DATA ****************
Hope this helps and thanks for the input thus far! I am still looking into it as well to see if I can figure it out on my own.
When looking at the source of your JCL as posted on SO I see TABs between //STUFF and DD in the two STUFF-lines. If they are there in your original JCL as well try replacing them by spaces. With JCL Blanks and TABs are not interchangeable.

UNIDENTIFIED OPERATION FIELD Error in JCL

I tried to run this following JCL program using IBM z/OS
//PAYMENT JOB MSGCLASS=H
//PAYMENT EXEC PGM=PAYMENT,REGION=1024K
// PARM='CSQ1,CARD.PAYMENTS,IND0163.REPLY,IND0163
// 5999.99,"MY PAYMENT"'
//STEPLIB DD DSN=ZOS.CONTEST3.PART2.LOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQLOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQANLE,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQAUTH,DISP=SHR
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
but after submission of the job ,when I'm trying to view the job output using SDSF , I'm getting IEFC605I UNIDENTIFIED OPERATION FIELD on line 3 and 4 !! can anyone tell me what's wrong with my program ...
Try ending lines 2 and 3 with a comma so the JCL reader knows that these lines are not yet complete (ie. continue on the following line).
//PAYMENT JOB MSGCLASS=H
//PAYMENT EXEC PGM=PAYMENT,REGION=1024K, <== continued...
// PARM='CSQ1,CARD.PAYMENTS,IND0163.REPLY,IND0163, <== continued...
// 5999.99,"MY PAYMENT"'
//STEPLIB DD DSN=ZOS.CONTEST3.PART2.LOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQLOAD,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQANLE,DISP=SHR
// DD DSN=WMQ.V6R0.SCSQAUTH,DISP=SHR
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//SYSPRINT DD SYSOUT=*

search if string from a pds is present in another pds

I have a pds (say A) having jobnames (superset).
I have another pds (say B) having lesser number of jobnames (subset).
best way to find a A-B into another file C using JCL ?
Try using SYNCORT JOINKEYS,
this example is pretty much
what you need. The JCL below is a specific example. AF1 is the Superset file (A) containing all job names, AF2 is the Subset
file (B). SORTOUT will contain the difference (A-B).
//MYJOB JOB Whatever your job card needs
//AMINUSB EXEC PGM=SYNCSORT,PARM='INCORE=OFF'
//AF1 DD * Superset file 'A'
J000001
J000002
J000003
J000004
J000005
J000006
J000007
J000008
J000009
J000010
J000011
J000012
/*
//BF2 DD * Subset file 'B'
J000001
J000003
J000004
J000008
J000010
J000011
/*
//SORTOUT DD SYSOUT=* 'A' - 'B'
//*
//SORTMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//STATOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(1,7,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,7)
OPTION COPY
END
/*
If you run this, SORTOUT will contain the following data:
J000002
J000005
J000006
J000007
J000009
J000012
Note: You will have to refomat the JOB card to whatever your installation requires. The rest should work pretty much
as illustrated.