|
View previous topic :: View next topic
|
| Author |
Message |
ronald masters
New User
Joined: 09 Dec 2015 Posts: 12 Location: uk
|
|
|
|
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 ? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
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. |
|
| Back to top |
|
 |
ronald masters
New User
Joined: 09 Dec 2015 Posts: 12 Location: uk
|
|
|
|
Thanks for those pointers Bill. I gave it a try with a single job step and these control statements:
| Code: |
SORT FIELDS=(121,18,CH,A, SORT ON BOOKING_OFFICE + ACCOUNT
53,14,CH,A) THEN AUT_DATE + AUT_TIME
OUTFIL SECTIONS=(121,18,TRAILER3=(1,256)),
NODETAIL,
REMOVECC
|
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.
Why the limitation? Or did I misunderstand ? |
|
| Back to top |
|
 |
ronald masters
New User
Joined: 09 Dec 2015 Posts: 12 Location: uk
|
|
|
|
By the way, it works with
| Code: |
SORT FIELDS=(121,18,CH,A, SORT ON BOOKING_OFFICE + ACCOUNT
53,14,CH,A) THEN AUT_DATE + AUT_TIME
OUTFIL SECTIONS=(121,18,TRAILER3=(001,200,
201,200,
401,200,
601,110)),
NODETAIL,
REMOVECC
|
|
|
| Back to top |
|
 |
ronald masters
New User
Joined: 09 Dec 2015 Posts: 12 Location: uk
|
|
|
|
| And CPU usage is about 40% of the two-step job |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
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. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3112 Location: NYC,USA
|
|
|
|
| Quote: |
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. |
Please have a look here on page-338 |
|
| Back to top |
|
 |
ronald masters
New User
Joined: 09 Dec 2015 Posts: 12 Location: uk
|
|
|
|
My mistake.
I am working with V2R1 but looking at the doc for V1R8.
All clear now. Thanks for your help everybody. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|