Hi All,
Here is the update after implementing the above code to my requirement.
I have two files INFILE1 and INFILE2 and below are the details:
INFILE1: A.B.C – LRECL=1025 – (I have around 2,50,00,000 records like below with different values)
Columns:
123. . .30. . .373839. . .570. . 574575. . . .. . . .. . 960. . .1025
Xxxxxxxxxxxxxxx605 xxxxxxxxxxxxxxxKL xxxxxxxxxxxxxxxN xxxxxxx
(ie. I have below values at the positions
Position value
37-39 605
574-575 KL
960 N )
INFILE2: B.C.D – LRECL=63 and below is the data
(I have around 17000 records like below with different values)
Columns
1234567890123 . . . . . . . . . . . . . . . . . . . . . . . .63
N600692** ABXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
(ie. I have below values at the positions
Position value
2-4 600
5-7 692
8-11 '** ' and
12-13 AB )
Note: There are no common fields between INFILE1 and INFILE2
My requirement is I have to compare the INFILE1 with INFILE2 based on below condition:
If INFILE1 POS 960 = ‘N’ and
INFILE2 POS 8-11 = ‘**’ and
(INFILE1 POS 37-39 >= INFILE 2 POS 2-4 and INFILE1 POS 37-39 <= INFILE 2 )
Take the value from INFILE2 POS 12-13 & keep the same in INFILE1 POS 574-575
I have written the below code based on the suggestion I have received for my earlier post and executed the same by taking only 10 records from INFILE1 and 17000 records from INFILE2 and it ran in
0.07 seconds.
OUTPUT:
Columns:
123. . .30. . .373839. . .570. . 574575. . . .. . . .. . 960. . .1025
Xxxxxxxxxxxxxxx605 xxxxxxxxxxxxxxxAB xxxxxxxxxxxxxxxN xxxxxxx
Second time, I ran by taking 2,29,00,000 records from INFILE1 and 17000 records from INFILE2 and
it is almost 2.5 hours and still the job is running.Could anyone please suggest me how to reduce the time to run the below code, since I have another 3 conditions similar to like this for the same files which I have to write in other control cards.
//SAUSRT02 EXEC PGM=ICETOOL,
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//INFILE1 DD DSN=A.B.C,DISP=SHR
//INFILE2 DD DSN=B.C.D,DISP=SHR
//TEMP1 DD DSN=C.D.E.TEMP1,DISP=(NEW,CATLG,DELETE),
// DCB=(SRCDSCB,RECFM=FB,LRECL=1025),
// SPACE=(1025,(50,50),RLSE),AVGREC=K
//SORTWK01 DD SPACE=(2048,(150,150),RLSE)
//SORTWK02 DD SPACE=(2048,(150,150),RLSE)
//SORTWK03 DD SPACE=(2048,(150,150),RLSE)
//SORTWK04 DD SPACE=(2048,(150,150),RLSE)
//TOOLIN DD *
COPY FROM(INFILE1) TO(TEMP1) USING(XBI0)
/*
//XBI0CNTL DD *
OPTION COPY
JOINKEYS F1=TEMP1,FIELDS=(1026,1,A),SORTED,NOSEQCK
JOINKEYS F2=INFILE2,FIELDS=(64,1,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,1025,F2:2,12)
INCLUDE COND=((960,1,CH,EQ,C'N'),AND,(1032,4,SS,EQ,C'**'),AND,
(38,3,ZD,GE,1026,3,ZD),AND,(38,3,ZD,LE,1029,3,ZD))
INREC BUILD=(1,574,1036,2,577,449)
/*
//JNF1CNTL DD *
INREC BUILD=(1,1025,X)
//*
//JNF2CNTL DD *
INREC BUILD=(1,63,X)
//*
/*
Thanks in Advance,
regards,