Joined: 05 Dec 2006
Location: Columbia, MO
|More SyncSort fun!
After RTFM'ing, I've gotten to a point where I need some advice. I've reformatted an input file into the layout I want using OUTREC. Now I want to add subtotals, but unlike the FM, I need 4 layers of subtotals, wach one totalling into the next one up and resetting on control breaks, etc.
Here's the easy part:
|OUTREC FIELDS=(01:01,01, COMPANY NUMBER
02:02,02, STATE ID
04:04,03, COUNTY CODE
07:07,29, COUNTY NAME
36:36,04, CITY CODE
40:40,30, CITY NAME
70:80,13, HIGH ORDER PREM
83:94,02, PREMIUM CENTS
85:48X,C' ') FILLER
10:01,01, COMPANY CODE
21:02,02, STATE ID
33:07,15, COUNTY NAME
55:40,25), CITY NAME
The (partial) output is:
|COMPANY: 1 STATE: 17 COUNTY: ACADIA CITY: Acadia Parish FD #8
SUBTOTAL: 704.00 RECORD COUNT 2
COMPANY: 1 STATE: 17 COUNTY: ALLEN CITY: Oakdale
SUBTOTAL: 459.00 RECORD COUNT 2
COMPANY: 1 STATE: 17 COUNTY: ASCENSION CITY: Donaldsonville
SUBTOTAL: 1,849.20 RECORD COUNT 5
COMPANY: 1 STATE: 17 COUNTY: ASCENSION CITY: Gonzales
SUBTOTAL: 505.00 RECORD COUNT 2
Very nice so far, except these all appear to be City breaks. The money subtotal for the city isn't rolling into a common bucket for the County, and then for the State, and finally for the company.
I know this something simple I've overlooked, but I'll be danged if I can figure out what. My money is that I haven't been specific enough with TRAILER3, but I'm not sure what to add to it.