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
 

 

Sort Step Needs to be Combined in ICETOOL Step

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

New User


Joined: 22 Apr 2005
Posts: 24
Location: New York, USA

PostPosted: Thu Apr 26, 2007 3:01 am    Post subject: Sort Step Needs to be Combined in ICETOOL Step
Reply with quote

Hi,
I am new to ICETOOL and really getting excited to explore and use this wonderful tool in our shop.

One of the jobs has the following steps -

Code:
//STEP1 EXEC PGM=SORT
//SORTIN    DD DSN=INFILE(0)
//             DISP=(SHR,KEEP,KEEP)
//SORTOUT   DD DSN=OUTFILE(+1),
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(1,1),RLSE),
//             DCB=(LRECL=1000,BLKSIZE=0,RECFM=FB)
//SYSIN     DD *
SORT FIELDS=(176,10,CH,A,258,10,CH,A)
OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')
SUM FIELDS=NONE
/*
//*
//STEP2  EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN1           DD DSN=OUTFILE(0),DISP=SHR
//IN2           DD DSN=OUTFILE(+1),DISP=SHR
//T1        DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//             DISP=(MOD,PASS)                       
//OUT12     DD DUMMY                                       
//OUT1      DD DUMMY                                       
//OUT2      DD DSN=SORTOUT(+1),
//             DISP=(NEW,CATLG,DELETE),                   
//             DCB=(RECFM=FB,LRECL=1000),                 
//             SPACE=(CYL,(5,5))                           
//TOOLIN   DD *
COPY FROM(IN1) TO(T1) USING(CTL1)                     
COPY FROM(IN2) TO(T1) USING(CTL2)                     
SPLICE FROM(T1) TO(OUT12) ON(1,1000,CH) WITH(1002,1) -
USING(CTL3) KEEPNODUPS                               
/*
//CTL1CNTL  DD  *
  INREC OVERLAY=(1001:C'11')
/* 
//CTL2CNTL  DD *
  INREC OVERLAY=(1001:C'22')
//CTL3CNTL DD  *
OUTFIL FNAMES=OUT12,INCLUDE=(1001,2,CH,EQ,C'12'),BUILD=(1,1000)
OUTFIL FNAMES=OUT1,INCLUDE=(1001,2,CH,EQ,C'11'),BUILD=(1,1000)
OUTFIL FNAMES=OUT2,INCLUDE=(1001,2,CH,EQ,C'22'),BUILD=(1,1000)
/*
//*


To explain what we are doing here is -
in Step1, we are converting a 648-byte file to a 1000-byte file sorted on 2 fields (as given in the sort card) excluding the Header (H) and Trailer (T). Then in Step2, we are trying to find out the records, which are present in the current generation of OUTFILE, but not present in the previous generation of the OUTFILE.

My question is, can we simplify Step2 by removing those DUMMY DSN in OUT12 and OUT1 & include the Sort logic in Step1 in the ICETOOL control card itself? The OUT2 file has to be sorted per the Sort order as given in Step1.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 26, 2007 3:35 am    Post subject:
Reply with quote

I believe you can simplify your two steps to one ICETOOL step like this (but I haven't actually tested it since I don't have your input data sets). I'm assuming you want to keep OUTFILE(+1) as a separate data set; if not, the job could be simplified even more.

Code:

//S1     EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN0   DD DSN=INFILE(0)
//         DISP=(SHR,KEEP,KEEP)
//IN1   DD DSN=OUTFILE(0),DISP=SHR
//OUT   DD DSN=OUTFILE(+1),
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(CYL,(1,1),RLSE),
//         DCB=(LRECL=1000,BLKSIZE=0,RECFM=FB)
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),
//            DISP=(MOD,PASS)
//OUT2     DD DSN=SORTOUT(+1),
//            DISP=(NEW,CATLG,DELETE),
//            DCB=(RECFM=FB,LRECL=1000),
//            SPACE=(CYL,(5,5))
//TOOLIN   DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
SELECT FROM(IN0) TO(OUT) ON(176,10,CH) ON(258,10,CH) -
   FIRST USING(CTL2)
SPLICE FROM(T1) TO(OUT2) ON(1,1000,CH) WITH(1002,1) -
  USING(CTL3) KEEPNODUPS
/*
//CTL1CNTL  DD  *
  INREC OVERLAY=(1001:C'11')
/*
//CTL2CNTL  DD *
  OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')
  OUTFIL FNAMES=OUT
  OUTFIL FNAMES=T1,OVERLAY=(1001:C'22')
//CTL3CNTL DD  *
  OUTFIL FNAMES=OUT2,INCLUDE=(1001,2,CH,EQ,C'22'),BUILD=(1,1000)
/*
//*
Back to top
View user's profile Send private message
Souvik.Sinha

New User


Joined: 22 Apr 2005
Posts: 24
Location: New York, USA

PostPosted: Thu Apr 26, 2007 5:52 pm    Post subject:
Reply with quote

Thanks Frank. It worked like a breeze! But I missed to mention one new requirement - the SORTOUT(+1) file has to be sorted in the following order as well:
(176,10,CH,A,258,10,CH,A)

Can I include that condition in the single step as well or do I need to add another step?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 26, 2007 9:19 pm    Post subject:
Reply with quote

Since you used ON(1,1000,CH) for SPLICE, it sorts the records that way.

If you need SORTOUT(+1) sorted on the other fields, then you'll have to do a separate sort for that after the SPLICE. The only way to avoid that would be if you can use ON(176,10,CH) ON(258,10,CH) for the SPLICE but that would compare on those fields instead of 1,1000,CH.
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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