<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.webhuis.nl:443/index.php?action=history&amp;feed=atom&amp;title=COBOL_Std_9_Output_Formatting_Rules</id>
	<title>COBOL Std 9 Output Formatting Rules - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.webhuis.nl:443/index.php?action=history&amp;feed=atom&amp;title=COBOL_Std_9_Output_Formatting_Rules"/>
	<link rel="alternate" type="text/html" href="https://wiki.webhuis.nl:443/index.php?title=COBOL_Std_9_Output_Formatting_Rules&amp;action=history"/>
	<updated>2026-09-11T08:01:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.webhuis.nl:443/index.php?title=COBOL_Std_9_Output_Formatting_Rules&amp;diff=4726&amp;oldid=prev</id>
		<title>Martin: Created page with &quot;== 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=&quot;wikitable&quot; style=&quot;width:100%&quot; ! Element !! Rule |- | Page heading || Written on the fi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.webhuis.nl:443/index.php?title=COBOL_Std_9_Output_Formatting_Rules&amp;diff=4726&amp;oldid=prev"/>
		<updated>2026-03-25T11:18:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== 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=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%&amp;quot; ! Element !! Rule |- | Page heading || Written on the fi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== 9. Output Formatting Rules ==&lt;br /&gt;
&lt;br /&gt;
=== 9.1 Print File Definition ===&lt;br /&gt;
&lt;br /&gt;
* Every print file must have an explicit LINAGE clause specifying lines-per-page, footing area, and bottom margin.&lt;br /&gt;
* Record length must be stated explicitly in the FD; for report files, 132 characters is the baseline.&lt;br /&gt;
* FILE STATUS must be checked after every OPEN, WRITE, and CLOSE.&lt;br /&gt;
&lt;br /&gt;
=== 9.2 Page Layout ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width:100%&amp;quot;&lt;br /&gt;
! Element !! Rule&lt;br /&gt;
|-&lt;br /&gt;
| Page heading || Written on the first line after a new-page trigger. Carries report title.&lt;br /&gt;
|-&lt;br /&gt;
| Column header || Written immediately after the page heading. Column names must match the data.&lt;br /&gt;
|-&lt;br /&gt;
| Data lines || Zero-suppress numeric fields (&amp;lt;code&amp;gt;PIC Z(9)&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Z(3)9&amp;lt;/code&amp;gt;). Pad with at least 2 spaces between columns.&lt;br /&gt;
|-&lt;br /&gt;
| End-of-page trigger || Fire EOP processing at &amp;lt;code&amp;gt;linage-counter = (lines-per-page − footing-area − 1)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Page footing || Right-aligned page number in format &amp;lt;code&amp;gt;page: ZZZZ9&amp;lt;/code&amp;gt;. Increment page counter after writing.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 9.3 New-Page Flag Pattern ===&lt;br /&gt;
&lt;br /&gt;
Control page breaks with a numeric flag (&amp;lt;code&amp;gt;SW-NEW-PAGE&amp;lt;/code&amp;gt;) rather than compiler-specific ADVANCE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cobol&amp;quot;&amp;gt;&lt;br /&gt;
       03 SW-NEW-PAGE          PIC 9 VALUE 1.&lt;br /&gt;
          88 NEW-PAGE-NEEDED   VALUE 1.&lt;br /&gt;
          88 NO-NEW-PAGE       VALUE 0.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set &amp;lt;code&amp;gt;SW-NEW-PAGE = 1&amp;lt;/code&amp;gt; at initialisation and after writing each page footing; clear to 0 after writing the heading.&lt;br /&gt;
&lt;br /&gt;
=== 9.4 Partial-Line Flush on Close ===&lt;br /&gt;
&lt;br /&gt;
When the UI &amp;quot;stop&amp;quot; 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.&lt;br /&gt;
&lt;br /&gt;
=== 9.5 Console Logging ===&lt;br /&gt;
&lt;br /&gt;
* Route all structured log messages through the UI program&amp;#039;s log-message method (&amp;lt;code&amp;gt;DISPLAY process-message UPON scherm&amp;lt;/code&amp;gt;).&lt;br /&gt;
* DISPLAY directly upon scherm is permitted only for emergency abort messages and low-level SQL diagnostic dumps.&lt;br /&gt;
* Structured messages must carry: program-name, paragraph-name, and a human-readable message of up to 92 characters.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;#039;&amp;#039;[[Cobol programming standards|← Back to index]]&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Martin</name></author>
	</entry>
</feed>