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 

ICETOOL: OUTFIL with multiple breaks & variable break ti

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


Joined: 30 Aug 2004
Posts: 19
Topics: 8

PostPosted: Mon Aug 30, 2004 2:49 pm    Post subject: ICETOOL: OUTFIL with multiple breaks & variable break ti Reply with quote

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:

Code:

----+----1----+----
010001WMW01AR061001
060001WMW01AR061001
100001WMW01AR061001
110001WMW01AR061001
150001WMW01AR061001
240001WMW01AR061001
250001WMW01AR061001
260001WMW01AR061001
270001WMW01AR061001
280001WMW01AR061001
300001WMW01AR061001
310001WMW01AR061001
430001WMW01AR061001
010002WMW01AR061001
060002WMW01AR061001
100002WMW01AR061001
110002WMW01AR061001
150002WMW01AR061001
240002WMW01AR061001
250002WMW01AR061001
260002WMW01AR061001
270002WMW01AR061001
280002WMW01AR061001
300002WMW01AR061001
310002WMW01AR061001
010003ELP12GA061001
060003ELP12GA061001
080003ELP12GA061001
100003ELP12GA061001


Columns of interest from above:

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.

Here is what I've written so far:

Code:


//STEP06   EXEC PGM=ICETOOL                 
//TOOLMSG  DD  SYSOUT=*                     
//DFSMSG   DD  SYSOUT=*                     
//SALESRPT DD DSN=TW01.SALESRPT,DISP=(NEW,CATLG,DELETE),   
//         LRECL=80,RECFM=FB,SPACE=(CYL,(5,1),RLSE)                 
//REPTOUT  DD SYSOUT=R     
//TOOLIN   DD *             

 SORT FROM(SALESRPT) USING(CTL1)

//CTL1CNTL DD *   

 SORT FIELDS=(7,3,CH,A,12,2,CH,A,3,4,ZD,A,1,2,ZD,A),EQUALS
 OUTFILE FNAMES=REPTOUT,
 HEADER2=('GROSS SALES REPORT'),
 SECTIONS=(4,4,SKIP=P,
                    HEADER3=('For the Company: ',7,3,/,
                                      'For the State: ',12,2,/,
                                       21:'610', 
                                       39:'629',
                                       57:'650',
                                       75:'655',
                                       93:'663',
                                       111:'925',
                                       126:'Totals',/,   
                                       21:'---',
                                       39:'---', 
                                       57:'---',
                                       75:'---', 
                                       93:'---',
                                       111:'---',
                                       126:'------'))   

OUTREC FIELDS=(1:1,2, 
                           3:C'-',
                           4:3,4,
                           9:20,6,PD,M5,
                           27:26,6,PD,M5,
                           45:32,6,PD,M5,
                           63:38,6,PD,M5, 
                           81:44,6,PD,M5,
                           99:50,6,PD,M5,
                           117:56,6,PD,M5) 

/*



Report I'm trying to produce (partial report shown):

Code:

GROSS SALES REPORT     
For the Company: WMW     
For the State: AR
                    610               629 
                    ---               --- 
01-0001   (4,319,187.59)             0.00  ...
06-0001     (234,820.07)             0.00  ...
10-0001     (279,758.22)      (478,503.28) ...
.
.
.


Report I'm actually producing (partial report shown):

Code:

GROSS SALES REPORT     
For the Company: 1
For the State: 4,       
                    610               629 
                    ---               --- 
01-0001   (4,319,187.59)             0.00  ...
06-0001     (234,820.07)             0.00  ...
10-0001     (279,758.22)      (478,503.28) ...
.
.
.


I sincerely appreciate any help anyone can offer.


Thanks,

Sterling Price
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 30, 2004 4:10 pm    Post subject: Reply with quote

Sterling price,

Try this jcl

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=(7,3,CH,A,12,2,CH,A,3,4,ZD,A,1,2,ZD,A),EQUALS     
  SUM FIELDS=(26,6,32,6,38,6,44,6,50,6,56,6),FORMAT=PD           
  OUTFIL REMOVECC,                                               
  OUTREC=(02:1,2,                                               
          10:3,4,                                               
          14:20,6,PD,M5,                                         
          31:26,6,PD,M5,                                         
          48:32,6,PD,M5,                                         
          65:38,6,PD,M5,                                         
          82:44,6,PD,M5,                                         
          99:50,6,PD,M5,                                         
         116:56,6,PD,M5),   
  HEADER1=(2/,35:'GROSS SALES REPORT ',75:'DATE:',&DATE,/,   
           80:X),                                             
  SECTIONS=(7,3,12,2,SKIP=P,                                 
  HEADER3=(1/,2:'FOR THE COMPANY: ',7,3,5X,'PAGE:',&PAGE,/,   
          02:'FOR THE STATE  : ',12,2,2/,                     
          02:'DIV',                                           
          10:'LOC',                                           
          26:'1ST',                                           
          43:'2ND',                                           
          60:'3RD',                                           
          77:'4TH',                                           
          94:'5TH',                                           
         111:'6TH',                                           
         128:'7TH',/,                                         
          02:'NUM',                                           
          10:'NUM',                                           
          26:'TOT',                                           
          43:'TOT',                                           
          60:'TOT',                                           
          77:'TOT',                                           
          94:'TOT',                                           
         111:'TOT',                                           
         128:'TOT',/,                                         
          02:'===',                                           
          10:'===',                                           
          26:'===',
          43:'===',
          60:'===',
          77:'===',
          94:'===',
         111:'===',
         128:'==='))
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
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: Mon Aug 30, 2004 4:57 pm    Post subject: Reply with quote

Sterling,

To understand what's happening here, take a look at the following Figure in "DFSORT Application Programming Guide":

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA00/FIGSTMTSEQ?SHELF=&DT=20031124143823&CASE=&ScrollTOP=FIGSTMTSEQ#FIGSTMTSEQ

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sterling Price
Beginner


Joined: 30 Aug 2004
Posts: 19
Topics: 8

PostPosted: Tue Aug 31, 2004 11:15 am    Post subject: Reply with quote

kolusu, Frank - thank you very much. I understand what is going on now.
Back to top
View user's profile Send private message
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