Thanks - The "getting started" guide gave me some good examples to start at, but I'm not sure how to get summary totals when using the OUTFIL. Disclaimer - the positions that are in my SYSIN are based on the production file layout (which has waaaaaaay more fields than I need). My initial post was a simplified version.
This is what I've got so far in my SYSIN. It produces a report showing all the unit numbers and the summed miles & gallons per state. Is there a way to get summed miles for each unit as well? I'm not sure I'm asking it correctly, so I 'll give an example of what my report is producing and what I really want.
//SYSIN DD *
INCLUDE COND=(15,6,CH,EQ,C'U00013')
INREC FIELDS=(25,8, UNIT NUMBER
11,2, STATE
75,5, MILES
80,5, GALLONS
70:X) ENSURE DATA LENGTH GREATER THAN HEADER/TRAILER LENGTH
SORT FIELDS=(25,8,CH,A,11,2,CH,A,1,10,CH,A)
OUTFIL FNAMES=RPT6,
NODETAIL,
HEADER2=(/,3:DATE,15:C'MILEAGE / GALLONS BY UNIT & STATE',50:PAGE,/,/,
3:'UNIT NBR ',13:'ST',17:'MILES',32:'GALLON',/,
3:'--------',13:'--',17:'-------------',32:'-------------'),
SECTIONS=(1,8,SKIP=0L,9,2,SKIP=0L,
TRAILER3=(3:1,8,
13:9,2,
17:TOT=(11,5,PD,EDIT=(I,III,III,IIT)),
32:TOT=(16,5,PD,EDIT=(I,III,III,IIT))))
/*
produces:
09/27/13 MILEAGE / GALLONS BY UNIT & STATE 1
UNIT NBR ST MILES GALLON
-------- -- ------------- -------------
U1260013 AZ 779 180
U1260013 CA 388 0
U1260013 LA 189 0
U1260013 MS 50 0
U1260013 NM 313 78
U1260013 NV 228 0
U1260013 TX 827 198
U1290013 AB 116 0
U1290013 AL 4,210 545
U1290013 AR 1,910 398
U1290013 AZ 6,271 1,174
U1290013 BC 999 0
U1290013 CA 6,608 623
U1290013 CO 1,828 74
What I'm trying to accomplish...
09/27/13 MILEAGE / GALLONS BY UNIT & STATE 1
UNIT NBR ST MILES GALLON
-------- -- ------------- -------------
U1260013 AZ 779 180
U1260013 CA 388 0
U1260013 LA 189 0
U1260013 MS 50 0
U1260013 NM 313 78
U1260013 NV 228 0
U1260013 TX 827 198
============== =============
TOTALS 2,774 456
U1290013 AB 116 0
U1290013 AL 4,210 545
U1290013 AR 1,910 398
U1290013 AZ 6,271 1,174
U1290013 BC 999 0
U1290013 CA 6,608 623
U1290013 CO 1,828 74
============== =============
TOTALS 21,942 2,814