Professional Documents
Culture Documents
I. IDENTIFICATION DIVISION.
INPUT FILES. List the internal name for each file used as input,
followed by its disk file name and the sort sequence (if any) of the
file.
OUTPUT FILES. List the internal name for each file used for
output, followed by its disk file name and the sort sequence (if
any) of the file.
INPUT-OUTPUT SECTION. Select files by the order in which they are used.
Level numbers.
Use non-contiguous level numbers in increments of five (05, 10,
15).
PICTURE clause.
The PICTURE of a data item should agree with its primary usage.
It should be alphanumeric unless used for computation,
subscription or editing. You should use Signed Numeric fields in
all cases except for subscripts, counters, etc.
FILE SECTION.
WORKING-STORAGE SECTION.
01 ACCUMULATORS.
Begin all data names with "A".
01 CONSTANTS.
Begin all data names with "C".
01 FLAGS.
Begin all data names with "F".
01 PRINT-LINES.
Begin all data names with "P".
01 WORK-AREAS.
Begin all data names with "W".
01 TABLES.
Begin all data names with "T".
Must be last entry in WORKING-
STORAGE.
There should be no Value clauses in the File Section except for 88-level entries,
which we will discuss.
I. PROCEDURE DIVISION.
General.
1000-INITIALIZE.
2000-COMPUTE-TAX.
3000-PRINT-REPORT.
PERFORMS:
PERFORM each paragraph except the driver. Don't let the program
control fall through from one paragraph to the next.
READ INPUT-FILE
AT END
MOVE "Y" TO S-EOF-INPUT
PERFORM 3200-OUT-OF-INPUT
END-READ.
Literals should only be coded when the value will never need to
be modified and when the significance of that value is very
obvious. For example:
ADD 1 TO A-PAGE-COUNT. (Acceptable)
MULTIPLY W-BASE-PAY BY 250.
(Unacceptable)
Modularity.
A paragraph has only one entry point and one exit point. .
IF.
IF condition statement
action statement
ELSE
action statement
END-IF
Arithmetic statements.
A double space after the last line of the report (before the
statistics, if required.)
******************END OF
REPORT********************
Maintain counts of all records from input files and of all record
written to output files. Additional quality control information
should be collected as needed (total number of errors, etc.) Print all
counts at the end of each report or job process.
******************************************************
****
STATISTICAL INFORMATION
******************************************************
****