PFILE


ANSI

 

The PFILE instruction defines spool files used for alternate PRINT spooling. It uses one of the following formats:

 

(1)

[label]

PFILE

 

(2)

[label]

PFILE

^

(3)

[label]

PFILE

%

(4)

[label]

PFILE

%%

 

Where:

label

Optional. A Program Execution Label.

^

Optional. Denotes the item as being a POINTER.

%

Optional. Denotes the item as being GLOBAL.

%%

Optional. Denotes the item as GLOBAL but does not initialize it in any way.

Flags Affected: NONE

Note the following:

  1. A PFILE must have been defined with a PFILE definition instruction before being referenced in a PRINT instruction.

  2. A SPLOPEN instruction must have been performed using the given PFILE variable before performing any PRINT instructions using the PFILE variable.

  3. The PFILE variable may not be in common and therefore is not kept open across program chains. A PFILE variable that is declared as GLOBAL is kept open across program chains.

  4. The ^ denotes a Pointer Variable.

  5. If the % form is used, the data item is placed in the Global Data Area. The variable would be available to other programs that also declared it with the percent form. Global Data Items are available with PLBCMP only.

  6. If the %% form is used, the data label is placed in the Global Data Area but no initialization takes place if it has not already been defined in the Global Data Area. Global Data Items are available with PLBCMP only.

 

Example 1:

 

PRTFILE

PFILE

 

PRTFILE may be used for print spooling.

 

Example 2:

 

PTRPFILE

PFILE

^

PFILE1

PFILE

 

PFILE2

PFILE

 

  

...

 

  

CALL

SUB USING PFILE1

  

CALL

SUB USING PFILE2

  

...

 

SUB

LROUTINE

PTRPFILE

  

...

 

  

PRINT

PTRPFILE;...

  

...

 

  

RETURN

 

 

PTRPFILE is a Pointer Variable that contains the address of another PFILE variable at execution time. This assignment is usually accomplished via the parameterized CALL instruction. Once initialized, PTRPFILE may be used as any other PFILE variable. It takes on all the attributes of the pointed to PFILE variable.

 

Example 3:

 

AUDIT

PFILE

%BUFFER=100

 

This instruction defines a global print file. It is kept open during the CHAIN instruction.

 

Example 4:

 

AUDIT

PFILE

%%

 

This instruction defines a global PFILE whose attributes are undefined. Prior to opening, it must be defined by performing a LOADMOD instruction or a CALL instruction of a separately compiled routine that defines the file with a '%' operator.

 

See Also: File Definitions, Printer Instructions

 



PL/B Language Reference IFILE SNDFILE