Posted: Mon Aug 30, 2004 2:49 pm Post subject: ICETOOL: OUTFIL with multiple breaks & variable break ti
I'm still very new to writing reports using ICETOOL/DFSORT, but I think I'm starting to get the hang of it. However, I don't seem to be doing something correctly regarding printing a value from the first input record of each section in the break titles.
The input dataset looks like this in columns 1-19:
01-02 division number
03-06 location number
07-09 company code
12-13 state
In the same file, columns 20-61 contain 7 PD fields, each with length 6:
20-25: Acct 610 amount
26-31: Acct 629 amount
32-37: Acct 650 amount
38-43: Acct 655 amount
44-49: Acct 663 amount
50-55: Acct 925 amount
56-61: Total of all accounts
My objective is to create a report showing the amounts for all accounts with:
- Page breaks (but no break totals) on company code breaks (07-09)
- Page breaks and break totals for all the PD columns on state breaks (12-13)
- Page breaks and break totals for all the PD columns on location number breaks (07-09)
Each page should contain header lines showing the current company and state, e.g.
For the company: WMW
For the state: AR
I'm having trouble getting the variable values from the data in the break titles, and I'm also not quite sure about how to go about setting up the break totals (I haven't tried that part yet).
Page 259 of the DFSort Application Programming guide (R14) states that the report 3 section header can contain "Unedited input fields from the first OUTFIL input record for which a data record appears in the section". That's what I'm trying to do, but apparently that the fields I'm printing in the section header are coming from the outfil output record.
In your job, you have an OUTREC statement and an OUTFIL statement. Notice in the Figure that the OUTREC statement is processed before the OUTFIL statement. So you're changing the records before OUTFIL sees them. Thus, OUTFIL uses your OUTREC records as its input records and the fields in HEADER3 are the changed fields from your OUTREC record, not from the original input records.
Kolusu's job does not use an OUTREC statement. Instead, it uses an OUTFIL statement with an OUTREC parameter. So OUTFIL uses your input records as its input records and HEADER3 gets the fields from the input records you want. OUTREC then reformats the data records for output the way you want them. Kolusu is also using SUM to get the totals, but depending on what you want to do, you might want to use TRAILER3 s instead of SUM to get the section totals since TRAILER3 is more flexible than SUM. _________________ 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
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