Cautions:
If you read a non-MAGEC file here, it is best to set appropriate values into the DB-REQUEST-AREA so that subsequent processing will work correctly. Be especially sure to set the DB-RETURN-CODE.
To exit this routine you should GO TO BA112-GET-JOINED-DATA, or just fall thru to that paragraph.
When you are bypassing records (as described above) do not forget to test the return code (IF NOT-FOUND) so as to stop at end-of-file.
###
Batch Insertion Point
%MVTOPRT
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- CA130-ADD-TOTALS
Description:
This insertion point is immediately after the generated logic which MOVE's from the sorted logical record to the detail print line (WS-DETAIL-LINE).
Suggested Uses:
You could modify the print-line here before it is actually written to the printer. If you wish to add some fields to (cont.)
the print line which were not defined in the specifications (from RPTDEF, online), you will need to MOVE WS-DETAIL-LINE (cont.)
to a work area which you have defined in %DATADEF, then make any alterations you wish, then MOVE it back to (cont.)
WS-DETAIL-LINE.
Cautions:
The maximum length of a print line is determined by your specifications in BCHPGM and by the hardware limitations of your printers.
To exit this routine you must fall thru to the generated code which immediately follows %MVTOPRT. That code will (cont.)
PERFORM DA100-PRINT and will then GO TO CA110-RETURN. If you wish, you could code your own print routine in %MVTOPRT to (cont.)
replace DA100-PRINT; just be sure to GO TO CA110-RETURN when you are done.
###
Batch Insertion Point
%MVTOSRT
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- BA150-RELEASE
Description:
This insertion point is immediately after the generated MOVE's which build the sort record from the logically joined data in DB-DATA-AREA.
Suggested Uses:
You can code your own additional MOVE's to override some of the values MOVE'd by the generated code.
You could code MOVE's to fill in fields in the sort record which were created as a result of your defining additional (cont.)
fields on the online RPTDEF screen, whether those fields were specified as displayable or non-displayable and whether (cont.)
they had a Source field specified or not.
You could accumulate some of your own statistics of records about to be released to the sort.
You could cause this record not to be released to the sort by coding a GO TO BA110-READ-NEXT.
Cautions:
If you wish to bypass some records (not release them to the sort), it is better to do that in %SELECT, if at all possible.
To exit this routine either fall thru to the RELEASE statement generated below it, or GO TO BA110-READ-NEXT.
###
Batch Insertion Point
%PREINIT
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- at the very top
Description:
This insertion point allows you to intercept the logic at the very beginning.
Suggested Uses:
If you are accessing IMS/DLI or other DBMS's, you may need to insert an ENTRY statement here.
Cautions:
The initialization has not been done yet, contents of work fields may be unpredictable. Initialization of the report (cont.)
break controls and page-break controls into the ACCUMULATORS-AREA has not been done yet.
The '*READ' CALL to MAGDBMS has not been done yet. Refer to discussion about the %INITWS insertion point regarding the `*READ` as well.
###
Batch Insertion Point
%REMARKS
Found in Model:
MODELRPT
Location:
ID DIVISION -- REMARKS
Description:
This insertion point allows you to insert comments into the beginning of the program.
Suggested Uses:
You could make your program easier to maintain by someone else.
Cautions:
The 1985 standard for Cobol removes the REMARKS section. You should code an asterisk (*) in column 7 of your comments (cont.)
so that MAGEC can maintain portability should you upgrade to the '85 compiler. All MAGEC-generated comments follow that (cont.)
convention.
###
Batch Insertion Point
%ROLLAC
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- DC100-ROLL-ACCUMULATORS
Description:
This insertion point is immediately behind the generated logic to "roll" the accumulated totals to the next break level and to zero them for this level.
Suggested Uses:
You could code logic to roll some accumulators which you have added to the ACCUMULATORS-AREA, via the %ACCUMS insertion point.
Cautions:
The subscripts THIS-LVL and NEXT-LVL control the operation of this routine. Be sure not to corrupt them.
To exit this routine GO TO DC199-EXIT.
###
Batch Insertion Point
%RPTEND
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- CA190-END
Description:
This insertion point is at the logical end of the output procedure of the sort. The default logic displays standard end-of-job counts and falls thru to the CA199-EXIT paragraph.
Suggested Uses:
If you do not want the end-of-job counts, of if you want others -- this is the place to DISPLAY/PRINT them. You should (cont.)
close the print file when you are done, unless you will close it in the %EOJ routine.
Cautions:
Remember, you have reached end-of-file on the sort file. Do not try to reference fields in the sort record.
To exit this routine you must GO TO CA199-EXIT, or fall thru to it.
###
Batch Insertion Point
%SELECT
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- BA115-SELECT
Description:
This logic is immediately before the RELEASE to the sort. It is in the input procedure of the sort.
Suggested Uses:
You can interrogate any fields in the input data since all reads and joins should already be done. You can cause this (cont.)
logical record to be processed, to be bypassed, or to simulate end-of-file by setting the appropriate value into (cont.)
PROCESS-INDICATOR.
Setting PROCESS-INDICATOR to P causes this record to be processed; setting it to B causes this record to be bypassed; (cont.)
setting it to E causes the program to act as if it has reached end-of-file on the input (no more records will be read, (cont.)
control passes to the output procedure).
PROCESS-INDICATOR is set to P (the default) just prior to the %SELECT insertion point.
Cautions:
Some sorts cannot handle "zero records sorted" very gracefully.
You should always exit this routine by coding GO TO BA150-RELEASE, or falling thru to it.
The sort record has not been built yet. You must interrogate the data in DB-DATA-AREA since it has not yet been MOVE'd to the sort record.
If you feel the need to do I/O using the MAGEC I/O module (MAGDBMS), be sure to save and restore DB-REQUEST-AREA. It would usually be much better to do the I/O's in %JOIN, rather than here.
###
Batch Insertion Point
%SUBRTNM
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- near physical end of program
Description:
This insertion point is provided so that you can insert entire routines which you can PERFORM from elsewhere. It is (cont.)
neither in the input section nor the output section of the sort, therefore, routines added here can be performed from (cont.)
either or both.
Suggested Uses:
You can insert virtually any type of routine here. There is no limit as to size or content.
Cautions:
Be aware of Cobol rules for using RELEASE and RETURN verbs from routines in, or PERFORMED from, the input/output procedures of a sort.
You should not use STOP RUN to terminate the program, use GOBACK or GO TO ZZ999-GOBACK.
To prevent errors resulting from accidentally falling through to an implied STOP RUN, the ZZ999-GOBACK routine is generated behind the %SUBRTNM insertion point.
###
Batch Insertion Point
%SVPREV
Found in Model:
MODELRPT
Location:
PROCEDURE DIVISION -- CA120-SAVE-KEYS
Description:
This insertion point is immediately before the generated logic to MOVE the key (sort) fields from the sorted record to the hold area which is used to compare against for controlling report breaks.
Suggested Uses:
You can alter what will be MOVE'd in order to force or prevent a control break. If you have added some of your own fields and wish to save them for later comparison, you can do that here.
You can cause certain report breaks to be suppressed by altering what is to be MOVE'd to the hold area, resulting in consolidations (i.e. Departments 0101, 0102, 0103 consolidated as Dept. 0100).
Cautions:
Report break and control logic is complex -- you should study it thoroughly before attempting to fool it by altering key values.
To exit this routine you must GO TO CA130-ADD-TOTALS, or just fall thru to that paragraph.