SPOOLED_FILE_DATA table function
The SPOOLED_FILE_DATA table function returns the content of a spooled file.
If the spooled file contains double byte data, the job CCSID must be a mixed CCSID.
Authorization: See Note below.
- A character string containing a qualified job name. Can contain the following special value:
- Use the name of the current job.
- A character string containing the name of the spooled file. If this parameter is omitted, QPJOBLOG is used.
- The number of the spooled file. If this parameter is omitted, the spooled file with the highest number matching spooled-file-name is used.
|Column Name||Data Type||Description|
|ORDINAL_POSITION||INTEGER||Relative position of this row in the spooled file.|
|SPOOLED_DATA||VARCHAR(200)||The data for this row in the spooled file.|
This function is provided in the SYSTOOLS schema as an example of how spooled file data can be returned by embedding the CPYSPLF CL command in an SQL table function. 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.
SELECT * FROM TABLE(SYSTOOLS.SPOOLED_FILE_DATA( JOB_NAME =>'193846/SLROMANO/QPADEV0009', SPOOLED_FILE_NAME =>'QSYSPRT')) ORDER BY ORDINAL_POSITION;