I have a job with two sort steps which is used to load a VSAM dataset.
Code:
//SORT1 EXEC PGM=SORT
//SORTMSG DD SYSOUT=*
//SORTIN DD DISP=(SHR,PASS),DSN=&&UNLOAD
//SORTOUT DD DISP=(NEW,PASS),SPACE=(CYL,(100,100),RLSE),DSN=&&SORTED
//SYSIN DD *
SORT FIELDS=(121,24,CH,A, SORT ON KEY
53,10,CH,D) THEN AUT_DATE (LATEST FIRST)
//*
//SORT2 EXEC PGM=SORT
//VIOSTAT1 DD DUMMY
//SORTMSG DD SYSOUT=*
//SORTIN DD DISP=(SHR,PASS),DSN=&&SORTED
//SORTOUT DD DISP=OLD,DSN=IUKX964.USTBL.TBL102BL
//SYSIN DD *
SORT FIELDS=(121,24,CH,A) SORT ON KEY
SUM FIELDS=NONE ELIMINATE DUPLICATES
OPTION EQUALS KEEP FIRST OF SUMMED RECORDS
I have not used ICETOOL before. At first I thought it might be able to do this in one step. But now having read the ICETOOL section of the manual, I have my doubts. Can anyone confirm please ?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Your second step looks as though the SORT is just to allow the use of SUM. That is always inefficient.
You don't need two steps, it can be done in one.
Have a look at OUTFIL reporting functions, with NODETAIL, REMOVECC and SECTIONS with TRAILER3, and you don't even need to sort on the date descending (if the dates are in ascending order, just remove that key, if in no order, sort ascending and the TRAILER3 will get the last one of the key).
If you want to use ICETOOL to do this, you'd look at the SELECT operator. Also look at the Smart DFSORT Tricks publication for how to do XSUM and more as well.
I could see how the output would be a report, but I could use this report like an output dataset without a CC char, each record would be a summary for each section (one per unique key in my case) and the NODETAIL effectively suppresses outrecs being written.
But the maximum of 256 on the TRAILER3 length. I don't get that. My output has what I want but only the first 256 bytes. I'd like to say (1,710), for example.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, can you paste the ICE201I message from the sysout of the step, please? The documented limit for a HEADER1 field (therefore TRAILER1, therefore TRAILER3) is 32752 bytes.
But the maximum of 256 on the TRAILER3 length. I don't get that. My output has what I want but only the first 256 bytes. I'd like to say (1,710), for example.
Code:
p,m
specifies that an unedited input field, from the first OUTFIL input record
for which a data record appears in the report, is to appear in the report
record.
p specifies the first byte of the input field relative to the beginning of the
OUTFIL input record. The first data byte of a fixed-length record has
relative position 1. The first data byte of a variable-length record has
relative position 5, because the first four bytes are occupied by the
RDW. All fields must start on a byte boundary, and no field can extend
beyond byte 32752. See “OUTFIL statements notes” on page 372 for
special rules concerning variable-length records.
m specifies the length in bytes of the input field. The value for m must be
between 1 and 32752.