Skip to main content

COBOL printed output is ignoring print control characters


Technote (FAQ)


Question

Why are the print control characters loaded into print buffer position 1 not being used?

Cause

The compiler option NOADV influences this.

Answer

If the NOADV compile time option is used, printer control characters are moved into print position 1 by the program.

The output printed file from a COBOL program coded with WRITE REC-NAME without the ADVANCING clause anywhere in the program and compiled NOADV will ignore any program preloaded carriage control characters.
*
DETAILS:
Under COBOL, if the NOADV compile time option is used and the printer control characters are loaded into print position 1 by the program, an AFTER ADVANCING clause must be used at least once in the program to trigger the access method to use the first position of each record as a printer control character. Otherwise, the output will be single spaced, the preloaded character will print as position 1 and the 132nd character will be shifted to the 133rd position and will be lost on a 132 character printer or
spooler.
*
SOLUTION:
Add one WRITE REC-NAME AFTER ADVANCING statement to the program.
*
A second option is available under zOS (or OS390 or MVS/ESA).
The user may code RECFM=FA, FBA, VB, or VBA in the DCB of the output file (or SYSOUT) DD statement and the first character will be analyzed correctly.

Cross Reference information
Segment Product Component Platform Version Edition
Software Development COBOL for VSE/ESA Compile VSE/ESA 1.1
Software Development COBOL for OS/390 & VM Compile VM/ESA 2.2

Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

Enterprise COBOL for z/OS

Compile


Software version:
3.4, 4.1, 4.2


Operating system(s):
z/OS


Reference #:
1004561


Modified date:
2010-12-01

Translate my page

Content navigation