Build Open Time Commands (QSPBOPNC) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Length of receiver variable Input Binary(4)
3 Format name Input Char(8)
4 Printer device name Input Char(10)
5 Printer data stream type Input Char(10)
6 Spooled file attributes Input Char(*)
7 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Build Open Time Commands (QSPBOPNC) API uses the attributes of the spooled file to build commands that must be sent ahead of the data to prepare the printer to print the spooled file. These commands are referred to as open time commands. The open time commands contain most of the file level commands needed to format the printed output.


Authorities and Locks

The user must have *USE authority to the printer device description.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The receiver variable receives the information requested. When the size of the area is smaller than the format requested, the API returns only the data the area can hold. If the size of the area is greater than the format, the area past the format is undefined.

Length of receiver variable
INPUT;BINARY(4)

The length of the receiver variable. The amount of data is truncated if the receiver variable is too small. Anything less than 8 bytes is not valid.

Format name
INPUT; CHAR(8)

The format of the information returned in the receiver variable.

The valid format name is:

OPNC0100 The open time commands for the spooled file.

Printer device name
INPUT; CHAR(10)

The name of the printer device description of the writer that was started.

The following special value is allowed:

*NONE The printer device is unknown.

Print data stream type
INPUT; CHAR(10)

The type of data stream recognized by the printer writer. This is used to determine the type of data to generate for open time command.

The valid special value is:

*SCS Systems Network Architecture (SNA) character string. A full set of SCS commands (similar to the set sent to a 3812 printer) is generated.

Spooled file attributes
INPUT; CHAR(*)

The attributes of the spooled file to be printed. These attributes are obtained by using the Retrieve Spooled File Attributes (QUSRSPLA) API, specifying format SPLA0200.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error Code Parameter.


OPNC0100 Format

The following table shows the information returned for the OPNC0100 format. For more details about the fields in the following table see, Field Descriptions.

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 BINARY(4) Offset to open time commands
12 C BINARY(4) Size of open time commands
    CHAR(*) Open time commands

Field Descriptions

Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned.

Offset to open time commands. The byte offset to the open time commands from the beginning of the format.

Open time commands. The open time commands, which contain most of the file level commands to format the output.

Size of open time commands. The size of the open time commands, in bytes.


Error Messages

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF2634 E Not authorized to object &1.
CPF2702 E Device description &1 not found.
CPF3CF1 E Error code parameter not valid.
CPF3C19 E Error occurred with receiver variable specified.
CPF3C21 E Format name &1 is not valid.
CPF3C24 E Length of the receiver variable is not valid.
CPF33E0 E Incomplete set of attributes provided.
CPF334C E Value &1 not valid for print data stream type.
CPF8105 E Device description &4 damaged.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V3R7
Top | Print APIs | APIs by category