![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNjG5wHvJLL3ZlfNIOq7ru__ZDXDYiqDH_U7vKlyZSIaveH57m0fhNTR1Ui0e3m9su_MaYIWziz4LuSSdySXaQbE5b2x1BqDXiBPw8AQ816Siw0-4cuF7qqHp4xK6M2XquEwHHvuJocBAh0qZMywaxSN3A0GQWwqKPaOIzZa61pPS1LRjIQxLzDG1b/s200/sql.png)
One of the first commands we all learn with IBM i is the Work with Spool Files command, WRKSPLF. With IBM i releases 7.5 and 7.4 TR6 comes a new SQL Table Function that is the equivalent of WRKSPLF.
The new Table Function, SPOOLED_FILE_INFO is found in library QSYS2, has parameters that match those of the WRKSPLF command. The syntax for the Table Function is:
SELECT * FROM TABLE(QSYS2.SPOOLED_FILE_INFO( USER_NAME => '*CURRENT', STARTING_TIMESTAMP => CURRENT_TIMESTAMP - 6 MONTHS, ENDING_TIMESTAMP => CURRENT_TIMESTAMP - 2 DAYS, STATUS => '*READY *HELD', JOB_NAME => '*', OUTPUT_QUEUE => '*LIBL/MYOUTQ', USER_DATA => 'SQL', FORM_TYPE => '*STD', SYSTEM_NAME => 'DEV750')) |
These parameters and their WRKSPLF equivalents are: