When you call C1PRPT, you must pass the following call areas in the order shown.
-
P9IN
-
P9OUT
-
P9AUDIT
-
C1PRPT
The P9IN, P9OUT, and P9AUDIT areas are the same areas that you use to call the C1MATCHx modules.
Each time you place a call to the C1MATCHx, you must also call C1PRPT (for example, call C1PRPT once for each input record in your file, plus once more to close processing). On all but the last call to C1PRPT, C1PRPT compiles statistics based on the match results of each record. On the last call (as indicated by an E in P9IFNC), C1PRPT prints the requested reports, using the statistics compiled on previous calls.
Between each call to C1MATCHx and C1PRPT, you must increase the counters for the number of input records read (RP-CT-AMA) and the number of input records processed (RP-CT-PRC). Additionally, you must reset the return code fields in the C1PRPT call area to reflect the return codes from C1MATCHx for your input record. These return code fields are RP-BM0ARC, RP-BM0CRC, RP-BM0SRC, RP-BM05RC, RP-BM09RC, and RP-BM0LOT.
Example Call Program
0050-INITIALIZE.* INITIALIZE FOR C1PRPT ROUTINEMOVE SPACES TO C1PRPT-CALLMOVE ZEROS TO RP-CT-NAM RP-CT-PRC RP-CT-BYP RP-CT-COK RP-CT-NCO RP-CT-IZP RP-CT-ZP4 RP-CT-AMA RP-CT-VAL RP-CT-APO RP-CT-MIL RP-CT-GOV* OTHER INITIALIZATION LOGIC...0050-EXIT. EXIT.0100-MAIN-LOOP.* READ INPUT RECORD PERFORM 0200-GET-INPUT-RECORD THRU 0200-EXIT IF END-OF-FILE PERFORM 0800-WRAPUP THRU 0800-EXIT ELSE ADD 1 TO RP-CT-NAM* MANIPULATE INPUT PERFORM 0300-PROCESS-RECORD THRU 0300-EXIT IF BYPASS-THIS-RECORD ADD 1 TO RP-CT-BYP PERFORM 0350-BYPASS-PROCESS THRU 0350-EXIT ELSE* INITIALIZE P9IN FIELDS PERFORM 0400-SETUP-P9IN THRU 0400-EXIT CALL 'C1MATCHx' USING P9IN P9OUT P9AUDIT ADD 1 TO RP-CT-AMA ADD 1 TO PR-CT-PRC MOVE P9OSAR TO RP-BM0ARC MOVE P9OCRC TO RP-BM0CRC MOVE P9OSRC TO RP-BM0SRC MOVE P9O5RC TO RP-BM05RC MOVE P9O9RC TO RP-BM09RC MOVE P9OLOT TO RP-BM0LOT* THE RP-BMOXXX CODES ABOVE CAN BE ADJUSTED AS REQUIRED... CALL 'C1PRPT' USING P9IN P9OUT P9AUDIT RPTPARM* PROCESS OUTPUT AND WRITE IT ADD 1 TO RP-CT-COK PERFORM 0500-WRITE THRU 0500-EXIT.0100-EXIT. EXIT....0800-WRAPUP. MOVE 'E' TO P9IFNC CALL 'C1MATCHx' USING P9IN P9OUT P9AUDIT* SET THE REPORT SELECTION FLAGS MOVE 'Y' TO RP-RPNDI...* SET THE REPORT DATE, HEADER, ADDITIONAL HEADERS & FOOTERS... CALL 'C1PRPT' USING P9IN P9OUT P9AUDIT RPTPARM.0800-EXIT. EXIT.