If your input file is presorted, it is more efficient to use type 7 logic to accumulate totals in a work field rather than allow CA Culprit to automatically total the fields each time a control break occurs on a SORT parameter.
Two different techniques for reporting total amounts by city are shown below:
IN 200 REC CONTROL-FLD 1 4 REC INPUT-FLD 5 9 2 0151*002 SAVE-FLD HH 'CONTROL' 0151*004 BUCKET HH 'AMOUNT' 010 SAVE-FLD ' ' 010 BUCKET 0 017 EOF = TAKE $Print last work field 017 CONTROL-FLD NE SAVE-FLD 100 $Control change? 017 INPUT-FLD + BUCKET BUCKET $Accumulate 017 DROP $Get next record 017100 RELS $Previous control-fld 017 MOVE CONTROL-FLD TO SAVE-FLD $Save current information 017 MOVE INPUT-FLD TO BUCKET $Save first amount 017 DROP $Get next
IN 200 REC CONTROL-FLD 1 4 REC INPUT-FLD 5 9 2 0261*002 CONTROL-FLD HH 'CONTROL' 0261*004 INPUT-FLD HH 'AMOUNT' 02SORT CONTROL-FLD 0 02OUT T 027 TAKE
Output
CONTROL AMOUNT BOSTON 136,409 CLEV 17,500 DENV 140,000 NYC 17,170 PHIL 267,000 SF 20,090 TAMP 2,000 600,169
When you are coding a CA Culprit report, keep in mind these efficiency guidelines:
|
Copyright © 2014 CA.
All rights reserved.
|
|