IBM AS/400 manual Accessing Printer Devices, Specifying PRINTER Files, Handling Page Overflow

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 340
Image 340
Accessing Printer Devices

Accessing Printer Devices

Accessing Printer Devices

PRINTER

files

of

ILE

RPG

programs

associate with the printer

files

on

system:

 

 

 

 

 

 

 

 

 

 

Printer

files

allow you to

print

output

files.

This chapter

provides

inf

to specify

and

use

printer files in

ILE RPG

programs.

 

 

Specifying PRINTER Files

To

indicate

that

you

want

your

program

to access printer files,

speci

the

device

name

for

the

file

in a File Description specification. Each

a unique file name.

A maximum of

eight

printer files is allowed

per p

PRINTER files can be either externally-described or program-described. indicators OA-OG and OV, fetch overflow, space/skip entries, and the PR

keyword are not allowed for an externally-described PRINTERILE file. See RPG for AS/400 Referencefor the valid output specification entries for an

externally-described file.DDSSeeReferencethe for information about the DDS for externally-described printer files.

For an externally-described PRINTER file, you can specify the DDS keyw INDARA. If you try to use this keyword for a program-described PRI get a run-time error.

You

can

use

the

CL command CRTPRTF (Create Print

File) to create a print

(see CLtheReference (Abridged)for further information on the CRTPRTF

command); or you can also use the IBM-supplied

fileDatanamesMan.- See the

agement manual

for

more information on these file names.

The

file

operation

codes that are valid for

a PRINTER file are WRIT

CLOSE,

and

FEOD.

For

a complete description of these operation codes, se

ILE

RPG

for AS/400

Reference.

 

Handling Page Overflow

An important consideration when you use a PRINTER file is page overflow. externally-described PRINTER file, you are responsible for handling page Do one of the following:

¹Specify an indicator, *IN01 through *IN99, as the overflow indicator

keyword OFLIND(overflow indicator) the Keywords field of the file desc specifications.

¹ Check the printer device feedback

section

of

 

the

INFDS

for

line

nu

 

page overflow. ReferILEtoRPGthefor

AS/400

Referencefor

more

informa-

 

 

 

tion.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

¹

Count

the

number of

output lines

per

 

page.

 

 

 

 

 

 

 

¹

Check

for

a

file exception/error

by

specifying

an

indicator

in posi

 

of the calculation

specifications

that specify the output operation,

 

fying

an

INFSR that

can handle the

error.

The

INFDS

has

detailed

i

 

on the file exception/error. See

Chapter 12,

“Handling Exceptions”

on

 

page 217

for

further information

on

exception

and error

handling.

 

316 ILE RPG for AS/400 Programmer's Guide

Page 340
Image 340
IBM AS/400 manual Accessing Printer Devices, Specifying PRINTER Files, Handling Page Overflow