- Initialize variable fields modules:
This module is executed only once.
- Print Headings Module:
Report headings are printed under two conditions at the start of a run and after a page full.
- Process Record Module:
This module involves the program’s read-process cycle. It performs the following three modules.
· Print-page-total-line
· Print-headings
· Write-report-line.
Print-Page-Total-Line Module:
This module is performed with each page break. It performs one other module write-report-line to print the page-total line on the report.
Print-Report-Total-Line Module:
This module is executed only once after all records are processed. It performs one other module write-report-line to print the report-line on the report.
Identify Common Modules:
Common modules are identified by shading the upper right-hand corner of the structure chart block.
Review Structure Chart:
After finishing the structure chart. We should review it to verify that it is complete and correct.
Number each Module:
The final step is to number the modules according to the module numbering conventions.
The accept from Date Statement:
- Report program includes the date that the report was generated
- Format
- To illustrate assume that a date field was defined in WORKING-STORAGE as following
01 WORK-AREAS.
05 WA-CURRENT-DATE.
10 CURRENT-YEAR PIC 9(2).
10 CURRENT-MONTH PIC 9(2).
10 CURRENT DAY PIC 9(2).
Then the date is made available to the program by the OS with execution of the following statement.
ACCEPT WA-CURRENT-DATE FROM DATE
The date from the OS is placed in this field This key word tells COBOL to obtain the current date from the operating system.
- WA-CURRENT-DATE
1 | 5 | 0 | 5 | 8 | 5 |
CURRENT-DAY CURRNET-MONTH CURRENT-YEAR
No comments:
Post a Comment