|
View previous topic :: View next topic
|
| Author |
Message |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
I have below Sort step running in production and I have seen some records are dropped during the sort process from file1 which they shouldn't have based on their actual file1 values. So to verify , I ran all the same steps with production files in Development region and I got the correct results which means no records got dropped but production one has missing records. What could have gone wrong , any idea?
| Code: |
//PS02 EXEC PGM=ICETOOL
//IN1 DD DSN=file1
//IN2 DD DSN=file2
// DD DSN=file3
//IN3 DD DSN=file4
//TEMP2 DD DSN=&&TEMP2,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//TEMP3 DD DSN=&&TEMP3,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//TEMP4 DD DSN=&&TEMP4,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//TEMP5 DD DSN=&&TEMP5,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(CYL,(100,100),RLSE)
//OUT1 DD DSN=filr5,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,VOL=SER=AAA01
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSABOUT DD SYSOUT=*
//SYSDBOUT DD SYSOUT=*
//TOOLIN DD DSN=pds(mem1),DISP=SHR
//CTL1CNTL DD DSN=pds(mem2),DISP=SHR
//CTL2CNTL DD DSN=pds(mem3),DISP=SHR
//CTL3CNTL DD2DSN=pds(mem4),DISP=SHR
//CTL4CNTL DD DSN=pds(mem5),DISP=SHR
//CTL5CNTL DD DSN=pds(mem6),DISP=SHR
pds(mem1)-
SORT FROM(IN1) TO(TEMP2) USING(CTL1)
SORT JKFROM TO(TEMP3) USING(CTL2)
SORT FROM(TEMP3) TO(TEMP4) USING(CTL3)
SORT FROM(IN3) TO(TEMP5) USING(CTL4)
SORT FROM(TEMP4) TO(TEMP5) USING(CTL5)
SORT FROM(TEMP5) TO(OUT1) USING(CTL4)
pds(mem2)-
SORT FIELDS=COPY
INCLUDE COND=((3,3,CH,EQ,C'AAA'),AND,(3500,1,CH,NE,C' '))
OUTREC FINDREP=(IN=C'+',OUT=C' ')
pds(mem3)-
JOINKEYS F1=TEMP2,FIELDS=(2913,10,A)
JOINKEYS F2=IN2,FIELDS=(11,10,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,7500)
OPTION COPY
pds(mem4)
SORT FIELDS=COPY
OUTREC BUILD=(C'.......' )
pds(mem5)
SORT FIELDS=COPY
pds(mem6)
SORT FIELDS=COPY
INREC BUILD=(1,500,SQZ=(SHIFT=LEFT)) |
Thanks,
Rohit |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Why use a SORT operator with a USING which contains SORT FIELDS=COPY? Just use the COPY operator.
You are SORTing both files for the JOIN, do you need to? Why don't you have JNFnCNTL files for the JOIN put INCLUDE/OMIT COND= in there, and also, since you only need the keys for the F2, just BUILD the key,
The SORT of TEMP3 you could do in the JOINKEYS main task. I have no clue as to why you do the final SORT (COPY).
As to if/why records may be missing, we have nothing to go on, as there is no information of what is missing, or even the sysout from the step missing and with. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
| I agree we can rewrite this better with your observation but do you see any strange could happen here and this in production since last 4 years? Conditions in mem2 and mem3 are satisfied for those 10 records which shouldn't have skipped from file to out1 in production. Input records count is around 12k. but the same things works fine in development region. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| As I said, no, not without further information. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
Thanks Bill.
It was a scheduling issue where the jobs are not scheduled properly. The file1 referenced above is created in job1 and the above step executes in job2Now in this case the Job1 ran 1 minute after job2 which then made job2 to refer file1's yesterday's generation where
wasn't true hence the results and during the testing in development region I was using current (Today's generation of Job1) as this was how scheduled in production and now this has been corrected. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|