MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Fab Beginner Joined: 15 Nov 2016 Posts: 47 Topics: 6
Posted: Thu Mar 08, 2018 11:29 am Post subject: Using the Same Tape Dataset in Joinkeys Jobs
Hello,
A friend just called me, he need to run this job:
Code:
//SORTC EXEC PGM=SORT,PARM='CORE=MAX'
//SORTIN1 DD DSN=THC.BT.IT.FN1.NEW.CAIS.VALID.SORTB.BPIT505,DISP=SHR
//SORTIN2 DD DSN=THC.BT.IT.FN1.NEW.CAIS.VALID.SORTB.BPIT505,DISP=SHR
//SORTOUT DD DSN=BT.IT.MC.NEW.CAIS.VALID.BPIT505.SORT2,
// DISP=(NEW,CATLG),
// UNIT=3390,SPACE=(CYL,(50,50)),
// DCB=(RECFM=FB,LRECL=1710,BLKSIZE=0)
//SORTWK01 DD SPACE=(CYL,1000),UNIT=SORT
//SORTWK02 DD SPACE=(CYL,1000),UNIT=SORT
//SORTWK03 DD SPACE=(CYL,1000),UNIT=SORT
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=SORTIN1,FIELDS=(21,23,A),SORTED,NOSEQCK
JOINKEYS F2=SORTIN2,FIELDS=(01,23,A)
REFORMAT FIELDS=(F1:01,1701, $ ALL BYTES FROM FILE1
F2:24,09) $ 9 BYTE COUNT
//*
//JNF2CNTL DD *
INREC BUILD=(21,23, $ KEY
C'000000001') $ 9 BYTE INIT-COUNT OF 1
SUM FIELDS=(24,9,ZD) $ SUM THE COUNT
//*
and it get this error
Code:
IEC146I 513-04,IFG0194A,BL15O£E4,SORTC,SORTIN1,22D2,X13569, 148
THC.BT.IT.FN1.NEW.CAIS.VALID.SORTB.BPIT505
WER999A BL15O£E4,SORTC , - UNSUCCESSFUL SORT 513 S REASON=00000004 ..
IEA995I SYMPTOM DUMP OUTPUT 150
SYSTEM COMPLETION CODE=513 REASON CODE=00000004
TIME=14.57.07 SEQ=11825 CPU=0000 ASID=00AB
PSW AT TIME OF ERROR 075C1000 80DB8446 ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00DB8440 - 4100302C 0A0D010D A7E5014B
AR/GR 0: 008CC9D8/00DB8750 1: 00000000/A4513000
If he run the job with two catalogued files everything is ok, but he need to run it by using two tape (identical), and get that abend above.
The reason this job is like this is better explained in this post:
https://www.mvsforums.com/helpboards/viewtopic.php?t=12757&highlight=joinkeys
Maybe the reason is because both sortin1 and sortin2 have the same name? weird. Why with two tape he gets that abend? Any kind of help would be really appreciated.
Thanks in advance
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Mar 08, 2018 12:51 pm Post subject:
Fab ,
You cannot Allocate the same TAPE to 2 different dd's in the same step. It is a physical tape and ONLY 1 dd can read it. You cannot use tape datasets for joinkey solution involving to matching the file to itself.
One option is to have a step earlier to do the counting and then use joinkeys
something like this
Code:
//SORTB EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=THC.BT.IT.FN1.NEW.CAIS.VALID.SORTB.BPIT505
//SORTOUT DD DSN=&&S,DISP=(NEW,PASS),
// UNIT=3390,SPACE=(CYL,(50,50))
//SYSIN DD *
OPTION DYNALLOC=(,8) $ Dynamic 8 SORTWK's
INREC BUILD=(21,23, $ KEY
C'000000001') $ 9 BYTE INIT-COUNT OF 1
SORT FIELDS=(01,23,CH,A) $ SORT ON KEY
SUM FIELDS=(24,09,ZD) $ SUM THE COUNT
/*
//SORTC EXEC PGM=SORT
//SORTIN1 DD DISP=SHR,DSN=THC.BT.IT.FN1.NEW.CAIS.VALID.SORTB.BPIT505
//SORTIN2 DD DISP=(OLD,PASS),DSN=&&S
//*
//SORTOUT DD DSN=BT.IT.MC.NEW.CAIS.VALID.BPIT505.SORT2,
// DISP=(NEW,CATLG),
// UNIT=3390,SPACE=(CYL,(50,50)
//SYSIN DD *
OPTION COPY
JOINKEYS F1=SORTIN1,FIELDS=(21,23,A),SORTED,NOSEQCK
JOINKEYS F2=SORTIN2,FIELDS=(01,23,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:01,1701, $ ALL BYTES FROM FILE1
F2:24,0009) $ 9 BYTE COUNT
//*
PS1: Please remove all the unnecessary DDnames in your JCL
PS2: I edited the topic title to a more meaningful title. _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum