Editing
COBOL Std 9 Output Formatting Rules
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 9. Output Formatting Rules == === 9.1 Print File Definition === * Every print file must have an explicit LINAGE clause specifying lines-per-page, footing area, and bottom margin. * Record length must be stated explicitly in the FD; for report files, 132 characters is the baseline. * FILE STATUS must be checked after every OPEN, WRITE, and CLOSE. === 9.2 Page Layout === {| class="wikitable" style="width:100%" ! Element !! Rule |- | Page heading || Written on the first line after a new-page trigger. Carries report title. |- | Column header || Written immediately after the page heading. Column names must match the data. |- | Data lines || Zero-suppress numeric fields (<code>PIC Z(9)</code> or <code>Z(3)9</code>). Pad with at least 2 spaces between columns. |- | End-of-page trigger || Fire EOP processing at <code>linage-counter = (lines-per-page β footing-area β 1)</code>. |- | Page footing || Right-aligned page number in format <code>page: ZZZZ9</code>. Increment page counter after writing. |} === 9.3 New-Page Flag Pattern === Control page breaks with a numeric flag (<code>SW-NEW-PAGE</code>) rather than compiler-specific ADVANCE: <syntaxhighlight lang="cobol"> 03 SW-NEW-PAGE PIC 9 VALUE 1. 88 NEW-PAGE-NEEDED VALUE 1. 88 NO-NEW-PAGE VALUE 0. </syntaxhighlight> Set <code>SW-NEW-PAGE = 1</code> at initialisation and after writing each page footing; clear to 0 after writing the heading. === 9.4 Partial-Line Flush on Close === When the UI "stop" method is invoked, pad remaining print columns with zeros (or spaces for string data) and keep calling the write paragraph until the new-page flag fires. This guarantees the last partial data line is always written before CLOSE. === 9.5 Console Logging === * Route all structured log messages through the UI program's log-message method (<code>DISPLAY process-message UPON scherm</code>). * DISPLAY directly upon scherm is permitted only for emergency abort messages and low-level SQL diagnostic dumps. * Structured messages must carry: program-name, paragraph-name, and a human-readable message of up to 92 characters. ---- ---- ''[[Cobol programming standards|β Back to index]]''
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information