Skip to main content

Problem:

This demo, "AfterAdvancing", creates a file using the "After Advancing" clause, that includes carriage return, line feed and form feed characters, unlike a program using "after positioning." The print program uses Byte-stream File Routines to read the report file, preserving the PC printer control characters, and providing control of the printer and font used to print the report.

Resolution:

INTRODUCTION

==========

This example illustrates how to use a report file created by a COBOL  program using "after advancing" syntax.

SOURCE FILES:

==========

Program Files      Description

----------------      -----------------------------------------------------------

Opcw32aa.cbl     osvsaa.cbl

OPERATION:

========

The example consists of two programs. OSVSAA.CBL is the program that uses  "after advancing" syntax. "Advancing" is available in all variations of  the COBOL standard. When used on the PC this method of paper control  results in the creation of "carriage return" (x"0D"), "line feed" (x"0A")  and "form feed" (x"0C") characters to achieve the desired spacing. The  report could be printed directly to the printer, or the report file could  be copied to the printer. However, Main Frame style reports are likely to  require more than 80 print positions per line of output, which is  normally the default state for the PC printer. To avoid making manual  adjustments to the printer settings, Osvsaa.cbl writes the report to a  sequential file. The only adjustment to the program that creates the  report will be to revise the page limit control in the program as the PC  printer is likely to print fewer lines per page than the Main Frame  printer.

The second program, OPCW32AP.CBL, reads the file created by OSVSAA.CBL  using Byte Stream I/O call-by-name routines that will preserve the  spacing in the report file and print the report using PC_PRINTER...  call-by-name routines. The "PC print control characters" in the file are  passed directly to the printer resulting in a properly spaced report. The  PC_PRINTER... routines give you control of which printer, as well as  which font, is used to produce the report.

==========================================================

Keywords: demonstration, sample, example, demo, printing afterAdvancing.zip

demo.ex

demo.me

demo.ne

demo.se

Attachments:

afteradvancing.zip

Old KB# 4042