Search multiple spoolfiles in AS400

Viewed 123

Search multiple spoolfiles in AS400

How do i search multiple spoolfiles at the same time in IBM AS400 for certain messages or errors?

Im no expert but i just would like to have a function that search all spoolfiles from a certain time o or jobs at the same time.

1 Answers

With Release 7.2 or Later and SYSTOOLS installed you can try the following Query.
It uses the QSYS2.OUTPUT_QUEUE_ENTRIES view and the SYSTOOLS.SPOOLED_FILE_DATA table function to list all Joblogs with Content in column SPOOLED_DATA.

SELECT JOB_NAME, OUTPUT_QUEUE_NAME, FILE_NUMBER, SPOOLED_DATA
FROM QSYS2.OUTPUT_QUEUE_ENTRIES OQE
CROSS JOIN TABLE(SYSTOOLS.SPOOLED_FILE_DATA(JOB_NAME => OQE.JOB_NAME, SPOOLED_FILE_NAME => OQE.SPOOLED_FILE_NAME, SPOOLED_FILE_NUMBER => OQE.FILE_NUMBER))
WHERE SPOOLED_FILE_NAME = 'QPJOBLOG';

Resources:
https://www.ibm.com/docs/en/i/7.3?topic=services-output-queue-entries-view https://www.ibm.com/docs/en/i/7.3?topic=services-spooled-file-data-table-function

Related