Put Spooled File Data (QSPPUTSP) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Put Spooled File Data (QSPPUTSP) API puts data into a spooled file, which was created using the Create Spooled File (QSPCRTSP) API. The data put in the spooled file is taken from a user space. The data in the user space can be created using the Get Spooled File Data (QSPGETSP) API or can be created by a user application.

Before a buffer is put in a spooled file, a limited validity check is performed on the information in the user space for that buffer. The possible errors that result from the values of the fields in the user space can be classified as follows:

The buffers must be in the format returned by the Get Spooled File Data (QSPGETSP) API and be in format SPFR0200.


Authorities and Locks

User Space Authority
*CHANGE
Library Authority
*EXECUTE
User Space Lock
*EXCLRD

Required Parameter Group

Spooled file handle
INPUT; BINARY(4)

The handle returned by the QSPCRTSP API.

Qualified user space name
INPUT; CHAR(20)

The name of the user space that contains the buffer of spooled information. The first 10 characters contain the user space name, and the second 10 characters contains the name of the library in which the user space is located. The special values allowed for the library name are *LIBL and *CURLIB. Both entries are left-justified. If no library is specified as the current library of the job, QGPL is used. The format of the user space is the same as that returned by QSPGETSP API. The format specified must be SPFR0200.

To see the format of the user space and how the offset values are calculated, see Format of the User Space.

Error code
I/O; CHAR(*)

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


Considerations When Changing or Creating a User Space

When creating your own spooled files or altering the buffers returned by the QSPGETSP API, incorrect data can be put with the QSPPUTSP API. Although errors are caught by the QSPPUTSP API, not all errors are detected.

If the order of the pages, the number of pages, or the number of lines is incorrect, problems can occur when repositioning the spooled file to print it. Repositioning means trying to start printing at a specific page other than page 1. The problems can be caused by:

There are fields in the buffer section of the user space that, if they contain incorrect values, could cause other functions, such as displaying or copying of spooled files, to work incorrectly. These fields are in the general information section and in the page data section.


Fields in the General Information Section

If the state and IPDS™ data fields contain incorrect or changed values, the Display Spooled File (DSPSPLF) and Copy Spooled File (CPYSPLF) commands can be affected in the following ways:


Fields in the Page Data Section

If the text data start and page offset fields contain incorrect or changed values, the Display Spooled File (DSPSPLF) command can be affected in the following ways:


Error Messages


API introduced: V2R1

[ Back to top | Print APIs | APIs by category ]