MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help with ICETOOL Job

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Omon
Beginner


Joined: 21 Apr 2005
Posts: 2
Topics: 1

PostPosted: Mon Dec 19, 2005 12:03 pm    Post subject: Help with ICETOOL Job Reply with quote

I have an existing job that processes the concatenation of files that have record tags for Header, Group & Letter. The ICETOOL splits the file, and creates Trailer record with the count of Group & Letter records.
Problem: if the Details file (containing Group & Letter records) is empty, I get garbage in the trailer record, and I was trying to fix it, so that I would get a good Trailer record with zeroes.
If it can be done with just changing the control cards and no JCL changes, that would be even better, b/c I won't need to re-migrate changes, just copy in the new control cards.

Here is the code:
Code:

//JSTEP010 EXEC PGM=ICETOOL                                       
//*------------------------------------------*                     
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD DSN=HEADER.FILE,DISP=SHR                 
//         DD DSN=DETAILS.FILE,DISP=SHR                 
//F1       DD DSN=&F1,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)       
//F2       DD DSN=&F2,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)       
//ALL      DD DSN=&ALL,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)       
//GRP      DD DSN=&GRP,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)       
//LTR      DD DSN=&LTR,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)       
//TRLR     DD DSN=&TRLR,DISP=(,PASS),SPACE=(CYL,(25,25),RLSE)     
//GRPIN    DD DSN=*.GRP,VOL=REF=*.GRP,DISP=OLD                     
//LTRIN    DD DSN=*.LTR,VOL=REF=*.LTR,DISP=OLD                     
//TRLRIN   DD DSN=*.ALL,VOL=REF=*.ALL,DISP=SHR                     
//         DD DSN=*.TRLR,VOL=REF=*.TRLR,DISP=OLD                   
//F1IN     DD DSN=*.F1,VOL=REF=*.F1,DISP=OLD                       
//F2IN     DD DSN=*.F2,VOL=REF=*.F2,DISP=OLD           
//CON      DD DSN=*.F1,VOL=REF=*.F1,DISP=OLD                   
//         DD DSN=*.F2,VOL=REF=*.F2,DISP=OLD                   
//OUT      DD DSN=OUTPUT.FILE.GDG(+1),         
//            DISP=(,CATLG,DELETE),                           
//            UNIT=SYSDA,SPACE=(CYL,(15,10),RLSE),             
//            DCB=(RECFM=FB,LRECL=1000)                       
//SORTWK01 DD  UNIT=SYSDA,SPACE=(CYL,(5,5))                   
//SORTWK02 DD  UNIT=SYSDA,SPACE=(CYL,(5,5))                   
//TOOLIN   DD *                                               
 COPY FROM(IN)           USING(CTL1)                           
 SORT FROM(GRPIN) TO(F1) USING(CTL3)                           
 SORT FROM(LTRIN) TO(F2) USING(CTL4)                           
 SPLICE FROM(CON) TO(TRLR) ON(1,10,CH) WITH(21,10) KEEPNODUPS 
 COPY FROM(TRLRIN) TO(OUT)                                     
/*                                                             
//CTL1CNTL DD *                                               
 OUTFIL FNAMES=GRP,INCLUDE=(1,10,CH,EQ,C'<<GROUP>  '),         
        OUTREC=(1:C'<TRAILER> ',11:C'0000000001',21:980X)     
 OUTFIL FNAMES=LTR,INCLUDE=(1,10,CH,EQ,C'<<LETTER> '),       
        OUTREC=(1:C'<TRAILER> ',10X,21:C'0000000001',31:970X)
 OUTFIL FNAMES=ALL,INCLUDE=(1,1,CH,EQ,C'<')                 
//CTL3CNTL DD *                                             
 SORT FIELDS=(1,10,CH,A)                                     
 SUM FIELDS=(11,10,ZD)                                       
//CTL4CNTL DD *                                             
 SORT FIELDS=(1,10,CH,A)                                     
 SUM FIELDS=(21,10,ZD)                                       
//           
                                                           

Here is how data looks on Detail file, when it's not empty:
Code:

<GROUP>                         
<LETTER>  111111111 01EN999999999
<<LETTER>                       
<LETTER>  111111111 12EN999999999
<INDVDUAL>Smith, Joe       
<INDVDUAL>Smith, Jane       
<<LETTER>                       
<<GROUP>                         
                                                           

Here is how data looks on Header file:
Code:

<HEADER>  Some Data Goes In the Header
           


All of the help is really appreciated.

--Mike.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Dec 19, 2005 12:25 pm    Post subject: Reply with quote

It's a little hard to jump in in the middle like this.

Could you please show me an example of the records in each input file for both the "non-empty" and "empty" cases, and what you want the output file to look like for each of those cases. What is the RECFM and LRECL of each input file?

Are you interested in a solution that requires less passes if I can come up with one?

Also, please run the following job and post the //SYSOUT output (substitute a blank for each b):

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//SORTOUT DD DUMMY
//SYSIN DD *
   OPTION COPY
   INREC OVERLAY=(5:C'A')
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Tue Dec 20, 2005 3:26 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Omon
Beginner


Joined: 21 Apr 2005
Posts: 2
Topics: 1

PostPosted: Mon Dec 19, 2005 1:36 pm    Post subject: Reply with quote

Frank,
the Input files & Output Files LRECL=1000, RECFM=FB.

The Header file always has 1 record data.
The Detail file is always in concatenation, but may or may not have data.
The sample of Detail file I posted. data past the tag (between
'<' and '>') is irrelevant.
I am having a problem when the Detail file is empty, my output file gets 2 records: Header and the second record is garbage.
I was thinking of adding somehow a Trailer rec with all zeroes to F1 & F2, but few things I tried didn't work.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Dec 19, 2005 5:01 pm    Post subject: Reply with quote

You say "The sample of Detail file I posted", but I don't see a Detail file in your example and I don't see any sample records. You say "The Header file", but I don't see a Header file in your example. All I see is DD statements and I don't know how those files relate to the "Header" and "Detail" files you refer to or what the records look like in any of the files you're using. That's why I asked for specific information in my first post to help me understand what you're doing so I could see how to help you.

If you can't or won't supply all of the information I asked for in my first post, then I can't help you. If you'd prefer to send me the information offline (yaeger@us.ibm.com), that's fine, but please put "DFSORT" somewhere in your Subject line to catch my attention.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Dec 20, 2005 4:26 pm    Post subject: Reply with quote

Mike,

Based on our offline conversations, here's a one-pass DFSORT job that will do what I think you want:

Code:

//JSTEP010 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=HEADER.FILE,DISP=SHR
//       DD DSN=DETAILS.FILE,DISP=SHR
//SORTOUT DD DSN=OUTPUT.FILE.GDG(+1),
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(15,10),RLSE)
//SYSIN DD *
  OPTION COPY
* Add +0 in 1001-1010 and 1011-1020 for all records
  INREC IFTHEN=(WHEN=INIT,
          OVERLAY=(1001:C'0000000000',1011:C'0000000000')),
* If the record has <<GROUP>, put +1 in 1001-1010
        IFTHEN=(WHEN=(1,10,CH,EQ,C'<<GROUP> '),
          OVERLAY=(1001:C'0000000001')),
* If the record has <<LETTER>, put +1 in 1011-1020
        IFTHEN=(WHEN=(1,10,CH,EQ,C'<<LETTER>'),
          OVERLAY=(1011:C'0000000001'))
  OUTFIL REMOVECC,
* Set up TRAILER1 with total of 1001-1010 and 1011-1020
    TRAILER1=(C'<TRAILER>',11:TOT=(1001,10,ZD,M11,LENGTH=10),
       21:TOT=(1011,10,ZD,M11,LENGTH=10)),
* Remove 1001-1020
    OUTREC=(1,1000)
/*


You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN and OVERLAY functions (that's why I asked you to run the OVERLAY job). If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

For the non-empty case, SORTOUT has:

Code:

HEADER> Some Data Goes In the Header     
GROUP>                                   
LETTER> 111111111 01EN999999999         
<LETTER>                                 
LETTER> 111111111 12EN999999999         
INDVDUAL>Smith, Joe                     
INDVDUAL>Smith, Jane                     
<LETTER>                                 
<GROUP>                                 
TRAILER> 00000000010000000002           


For the empty case, SORTOUT has:

Code:

<HEADER> Some Data Goes In the Header
<TRAILER> 00000000000000000000   

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group