IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can Icetool generate control total file ?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NCROLL

New User


Joined: 19 May 2008
Posts: 5
Location: UK

PostPosted: Thu Oct 09, 2008 4:42 pm
Reply with quote

Using an input set of data I need to create a single record control total file. I cannot figure out how to do the whole of this in one step. Perhaps it is not possible and as such I should just write a cobol program ?

Please see the example that is attached.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 09, 2008 4:46 pm
Reply with quote

Please do not post attachments as many people are restricted from opening these, thus reducing the number of people available to help you.

Post the data as text, and Click HERE to see how to use tags to make your post more easily readable
Back to top
View user's profile Send private message
NCROLL

New User


Joined: 19 May 2008
Posts: 5
Location: UK

PostPosted: Thu Oct 09, 2008 5:03 pm
Reply with quote

Code:

DATA IN                                                       
< MISC DATA              >< AMOUNT FIELD     >               
2550GBP   0000    000.000N                .00                 
5278GBP   0000    000.000N           -6312.19                 
0019GBP   0000    000.000N              -7.16                 
1101GBP   0636    006.360N            6064.71                 
1101GBP   0662    006.620N          -32609.99                 
1101GBP   0710    007.100N             217.79                 
1101GBP   2102    021.020N             290.32                 
1101GBP   2112    021.120N            3791.76                 
**************************************************************
AUDIT RECORD TO BE GENERATED                                 
<FLD 1       ><FLD 2><FLD 3        ><FLD 4        ><FLD 5>   
091020081124010000008+00000010364.58-00000038939.34N         
FLD 1 = DATE AND TIME JOB RAN AT                             
FLD 2 = RECORD COUNT                                         
FLD 3 = TOTAL CREDITS FROM AMOUNT FIELD                       
FLD 4 = TOTAL DEBITS  FROM AMOUNT FIELD                       
FLD 5 = EMTPY FLAG - IE. IF RECORD CNT = 0000 THEN SHOULD BE Y
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Oct 09, 2008 10:05 pm
Reply with quote

NCROLL,

The following DFSORT JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                               
2550GBP   0000    000.000N                .00                 
5278GBP   0000    000.000N           -6312.19                 
0019GBP   0000    000.000N              -7.16                 
1101GBP   0636    006.360N            6064.71                 
1101GBP   0662    006.620N          -32609.99                 
1101GBP   0710    007.100N             217.79                 
1101GBP   2102    021.020N             290.32                 
1101GBP   2112    021.120N            3791.76                 
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)   
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:19C'0')),               
  IFTHEN=(WHEN=(27,19,SFF,LT,0),OVERLAY=(81:27,19,27:19C'0'))
  OUTFIL REMOVECC,NODETAIL,BUILD=(52X),                       
  TRAILER1=(DATENS=(DM4),TIMENS=(24),                         
            COUNT=(M11,LENGTH=7),                             
            TOT=(27,19,SFF,EDIT=(+TTTTTTTTTTT.TT)),           
            TOT=(81,19,SFF,EDIT=(-TTTTTTTTTTT.TT)),'N')       
/*                                                           
//STEP0200 EXEC PGM=ICEMAN                                   
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=&&T1,DISP=SHR                               
//SORTOUT  DD SYSOUT=*                                       
  SORT FIELDS=COPY                                           
  INREC IFTHEN=(WHEN=(15,7,ZD,EQ,0),OVERLAY=(52:C'Y'))       
/*                                                           
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Oct 09, 2008 10:17 pm
Reply with quote

NCROLL,

<Oops - Kolusu beat me to it. Well, you asked for one step and this version does it in one step, so I'll leave it here.>

Here's a DFSORT/ICETOOL job that will do what you asked for.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/46)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/58)
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFOUTLEN=52,
        IFTHEN=(WHEN=(27,19,SFF,GE,0),
           BUILD=(1:27,19,UFF,TO=ZD,LENGTH=19)),
        IFTHEN=(WHEN=NONE,
           BUILD=(20:27,19,SFF,TO=ZD,LENGTH=19))
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    TRAILER1=(DATENS=(MD4),TIMENS=(24),COUNT=(M11,LENGTH=7),
       TOTAL=(1,19,ZD,EDIT=(+TTTTTTTTTTT.TT)),
       TOTAL=(20,19,ZD,EDIT=(-TTTTTTTTTTT.TT)),C'N')
/*
//CTL2CNTL DD *
  INREC IFOUTLEN=58,
    IFTHEN=(WHEN=(15,7,ZD,EQ,0),OVERLAY=(52:C'Y'))
/*
Back to top
View user's profile Send private message
NCROLL

New User


Joined: 19 May 2008
Posts: 5
Location: UK

PostPosted: Fri Oct 10, 2008 7:29 pm
Reply with quote

Skolusu and Frank Yaeger,

thank you both for your replies. The code you have both kindly provided is exactly what I was looking for though it was not clear to me how to achieve this.

Having seen the statements I'm now going through the code to understand exactly what each means.

This is thankfully going to save a lot of effort writing some noddy cobol programs.

Thanks again.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top