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

Create an output summary file


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

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Thu Apr 26, 2007 3:08 am
Reply with quote

I need of your help again. I need to create a summary file. The file attributes are as follows.

Input file:
LRECL: 73
RECFM: FB
The input file appears as follows:

Code:
----+----1----+----2----+----3----+----4----+----5----+---
CB6W001001                       F 000001000000000001
CB6W001001                       F 000001000001000001
CB6W001001                       F 000001000001000000
CB6W001001                       F 000001000000000001
CB6W001001                       F 000001000001000000
CB6W001001                       F 000001000001000000
CB6W001001                       F 000001000001000000
CB6W001001                       F 000001000001000000
CB6W001001                       F 000001000000000001
CB6W001001                       F 000001000001000000
----+----1----+----2----+----3----+----4----+----5----+---


I have to total the entries in column 36, 42, 48. For each record there can be multiple total counts. Beginning in column 5 for a length of 6 is the customer number, beginning in column 36 for a length of 6 is the read count, beginning in column 42 for a length of 6 is the update count, and beginning in column 48 for a length of 6 is the add count.

The file attributes of the output file are:

Output file:
LRECL: 80
RECFM: FB

The output FD is:

Code:
01 ICE-TOOL-OUT.
      05  ITO-CUST-NBR      PIC X(06).
      05  ITO-READ-CNT-TTL            PIC 9(06).
      05  ITO-UPDATE-CNT-TTL        PIC 9(06).
      05  ITO-ADD-CNT-TTL             PIC 9(06).




Desired output

Code:
----+----1----+----2----+----3----+----4----+----5----+---
001001000010000007000004
----+----1----+----2----+----3----+----4----+----5----+---



As always thank you for your help.
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 Apr 26, 2007 3:43 am
Reply with quote

Bill,

Do you just want the totals for all of the records, or do you want totals for each customer number? You only show one customer number, but could there be more?
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 Apr 26, 2007 4:06 am
Reply with quote

Quote:
For this particular task there will be just one customer number.


Bill,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/73)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    BUILD=(1,73,80:X),
    TRAILER1=(5,6,
       TOT=(36,6,ZD,M11,LENGTH=6),
       TOT=(42,6,ZD,M11,LENGTH=6),
       TOT=(48,6,ZD,M11,LENGTH=6))
/*
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Thu Apr 26, 2007 7:32 pm
Reply with quote

Your resolution worked superbly. Thank you.

I had worked on a resolution that was to complicated. My resolution was checking for input field values and "overlaying" depending on those values.

Once again thank you.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
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
Search our Forums:

Back to Top