Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
The iQuery.RTVLASTSPLF() UDTF returns a one row result that returns the ID of the most recently created SPOOLED file within the job running the UDTF.
This UDTF has no parameters.
Column | Type | Description |
SPLFNAME | varchar(10) | The name of the SPOOLED File. |
JOB | varchar(28) | The fully qualified Job name of the job running the RTVLASTSPLF UDTF. |
JOBNAME | varchar(10) | The Job name of the job running the RTVLASTSPLF UDTF. |
JOBUSER | varchar(10) | The Job User name of the job running the RTVLASTSPLF UDTF. |
JOBNBR | varchar(6) | The Job Number of the job running the RTVLASTSPLF UDTF. |
SPLNBR | int | The SPOOLED file number. |
DATE_OPEN | DATE | The date the SPOOLED file was created (open for processing) |
TIME_OPEN | TIME | The time the SPOOLED file was created (open for processing) |
ERRMSGID | varchar(7) | If an error is generated while retrieving the SPOOLED File ID, that CPF message ID is copied to this column for simplified diagnostics. |
The following example returns the Last SPOOLED File ID.
select splfname,job,splnbr
INTO :name, :job :splnbr
from table( iQuery.RTVLASTSPLF() ) lastSplf;