Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

can I do this 2-step sort with ICETOOL in a single step ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ronald masters

New User


Joined: 09 Dec 2015
Posts: 12
Location: uk

PostPosted: Thu Dec 10, 2015 3:50 pm    Post subject: can I do this 2-step sort with ICETOOL in a single step ?
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Dec 10, 2015 4:10 pm    Post subject: Reply to: can I do this 2-step sort with ICETOOL in a single step ?
Reply with quote

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
View user's profile Send private message
ronald masters

New User


Joined: 09 Dec 2015
Posts: 12
Location: uk

PostPosted: Thu Dec 10, 2015 9:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ronald masters

New User


Joined: 09 Dec 2015
Posts: 12
Location: uk

PostPosted: Thu Dec 10, 2015 9:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ronald masters

New User


Joined: 09 Dec 2015
Posts: 12
Location: uk

PostPosted: Thu Dec 10, 2015 9:08 pm    Post subject:
Reply with quote

And CPU usage is about 40% of the two-step job
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Dec 10, 2015 9:57 pm    Post subject: Reply to: can I do this 2-step sort with ICETOOL in a single step ?
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Dec 10, 2015 10:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ronald masters

New User


Joined: 09 Dec 2015
Posts: 12
Location: uk

PostPosted: Thu Dec 10, 2015 10:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us