I need some guidance on a small report.
I have an input file which contains around 2 million records. File is about 115 in record length.
I am sorting by 2 fields 1 byte each.
I am summing up by a third field, and need to count the records by sort by fields, keeping subtotals by the inner field and totals by the outer by field.
My issue is that,
1) Count is giving always 1 as result, and is wrong
2) Is adding an extra record to put the count result.
how can I solve this?
I am assuming that the trailer3 I am using is wrong.
Or maybe is when it executes first the sum deletes the duplicate records and by the time it gets to count them is only 1 of them.
How can I force the count result to the end of the same record?
I tried using OUTREC, but how can I specify the name of the count field?
Here is my code
INREC FIELDS=(015,050, ID
081,001, TYPE
085,003, H CODE
096,008, ENTITIES #
105,010) DATE
SORT FIELDS=(81,1,A,85,03,A),FORMAT=CH
SUM FIELDS=(96,8,ZD)
OUTFIL REMOVECC,
SECTIONS=(81,1,
85,3,
TRAILER3=(81,1,
83,3,
'=',
COUNT=(M11,
LENGTH=08)))
081,001, TYPE
085,003, H CODE
096,008, ENTITIES #
105,010) DATE
SORT FIELDS=(81,1,A,85,03,A),FORMAT=CH
SUM FIELDS=(96,8,ZD)
OUTFIL REMOVECC,
SECTIONS=(81,1,
85,3,
TRAILER3=(81,1,
83,3,
'=',
COUNT=(M11,
LENGTH=08)))
Thanks
Miguel
Code'd