Start of change

PRINTER_FILE_INFO view

The PRINTER_FILE_INFO view returns many attributes of IBM i printer files.

The information is returned by using the Display File Description (DSPFD) CL command.

Authorization: See Note below.

The following table describes the columns in the view. The system name is PRTF_INFO. The schema is SYSTOOLS.

Table 1. PRINTER_FILE_INFO view
Column name System column name Data type Description
PRINTER_FILE_LIBRARY PRTF_LIB VARCHAR(10) Name of the library that contains the printer file.
PRINTER_FILE PRTF VARCHAR(10) Name of the printer file.
SPOOLED_OUTPUT_QUEUE_LIBRARY OUTQ_LIB VARCHAR(10)
Nullable
Library containing output queue for spooled files.

Contains the null value if SPOOLED_OUTPUT_QUEUE is *JOB.

SPOOLED_OUTPUT_QUEUE OUTQ VARCHAR(10) Output queue for spooled files. Can contain the following special value:
*JOB
The output queue for the job is used.
OWNER OWNER VARCHAR(10) The owner of the printer file
DEFINER DEFINER VARCHAR(10) The user who created the printer file.
CREATE_TIMESTAMP CREATED TIMESTAMP The time the printer file was created.
LAST_USED_TIMESTAMP LAST_USED TIMESTAMP
Nullable
The time the printer file was last used.

Contains the null value if the printer file has never been used.

SIZE SIZE DECIMAL(15,0) The size of the printer file.
TEXT_DESCRIPTION TEXT VARCHAR(50)
Nullable
Descriptive text for the printer file.

Contains the null value if there is no text description.

MAXIMUM_RECORDS MAXRCDS INTEGER
Nullable
The maximum number of records allowed in the spooled file.

Contains the null value if there is no maximum.

FILE_AVAILABLE FILEAVAIL VARCHAR(8) The time when a spooled file becomes available to an output device for processing.
*FILEEND
The file is available as soon as the file is closed.
*IMMED
The file is available as soon as the file is opened.
*JOBEND
The file is available when the job that owns the file is completed.
COPIES COPIES INTEGER The number of copies for a spooled file.
HOLD HOLD VARCHAR(3) Hold spooled file.
NO
Spooled file is not held.
YES
Spooled file is held.
SAVE_AFTER_WRITE SAVE VARCHAR(3) Save spooled file after is is written.
NO
Do not keep the spooled file.
YES
Keep the spooled file.
OUTPUT_PRIORITY OUTPTY VARCHAR(4) For spooled output, the assigned priority on the output queue. Can contain the following special value:
*JOB
The output priority associated with the job that created the spooled file is used.
USER_DATA USER_DATA VARCHAR(10) For spooled output, user-specified data that identifies the file. Can contain the following special value:
*SOURCE
If the spooled file was created by an application program, the name of the program is used. Otherwise, blanks are used.
SPOOLED_FILE_OWNER SPOOL_OWN VARCHAR(10) For spooled output, the owner assigned to the spooled file. Can contain the following special values:
*CURGRPPRF
The spooled file is owned by the current effective group profile of the current job or thread.
*CURUSRPRF
The spooled file is owned by the current effective user of the current job or thread.
*JOB
The spooled file is owned by the original user profile of the job.
*JOBGRPPRF
The spooled file is owned by the group profile of the original user profile of the job.
FORM_TYPE FORM_TYPE VARCHAR(10) Type of form on which the output is printed.
PAGE_LENGTH PAGE_LEN DECIMAL(6,3) The page length, in lines per page, used by the spooled file.
PAGE_WIDTH PAGE_WIDTH DECIMAL(6,3) The page width, in characters per printed line, used by the spooled file.
LINES_PER_INCH LPI DECIMAL(3,1) The line spacing setting on the printer, in lines per inch.
CHARACTERS_PER_INCH CPI DECIMAL(3,1) The printer character density, in characters per inch.
EXTERNALLY_DESCRIBED EXT_DESC VARCHAR(3) Externally described attribute.
NO
File is not externally described.
YES
File is externally described.
NUMBER_RECORD_FORMATS FORMATS INTEGER The number of record formats defined for the printer file
RECORD_FORMAT RCDFMT CLOB(1M) CCSID 1208
Nullable
A list of record formats for the printer file. The value is returned as a JSON array, with each array element containing a JSON object with information for one format. The array name is RCDFMT. The array elements consist of:
  • The format name, with a key of FORMAT_NAME
  • The number of fields in the format, with a key of FORMAT_NUMBER_FIELDS
  • The length of the format, with a key of FORMAT_RECORD_LENGTH
  • The format level ID, with a key of FORMAT_LEVEL_ID
  • Descriptive text for the format, with a key of FORMAT_TEXT

Contains the null value if record format information is not available for this printer file.

Note

This function is provided in the SYSTOOLS schema as an example of returning information from a CL command's OUTFILE. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.

Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.

Example

  • Look at some printer file attributes for printer files in library APPLIB1.
    SELECT PRINTER_FILE, TEXT_DESCRIPTION, MAXIMUM_RECORDS, OUTPUT_PRIORITY, FORM_TYPE
      FROM SYSTOOLS.PRINTER_FILE_INFO
      WHERE PRINTER_FILE_LIBRARY = 'APPLIB1';
  • Expand the list of record formats for printer file APPLIB1/INVOICE.
    SELECT J.* 
    FROM SYSTOOLS.PRINTER_FILE_INFO,
         JSON_TABLE(RECORD_FORMAT, 'lax $.RCDFMT'
              COLUMNS (FORMAT_NAME VARCHAR(10),
                       FORMAT_FIELDS INTEGER,
                       FORMAT_LENGTH INTEGER,
                       FORMAT_LEVEL_ID CHAR(13),
                       FORMAT_TEXT VARCHAR(50)
               )) J
     WHERE PRINTER_FILE_LIBRARY = 'APPLIB1' AND PRINTER_FILE = 'INVOICE';
End of change