Stack di tutti i lavori interattivi
Per avere una “trace” delle esecuzioni di tutti i lavori interattivi “utente” attivi sul Sistema:
WITH JOBINFO AS(SELECT JOB_NAME, JOB_TYPE FROM TABLE(QSYS2.JOB_INFO( JOB_STATUS_FILTER => '*ACTIVE', JOB_USER_FILTER => '*ALL'))A WHERE JOB_TYPE = 'INT' AND SUBSTR(JOB_NAME, 8, POSSTR(SUBSTR(JOB_NAME, 8), '/')-1) NOT LIKE 'Q%' ), STACK AS(SELECT * FROM JOBINFO, TABLE(QSYS2.STACK_INFO(JOB_NAME, 'ALL')) X WHERE STATE00001 IS NOT NULL ) SELECT * FROM STACK
Result:
--- JOB_NAME JOB_TYPE THREAD_ID THREAD_TYPE ORDINAL_POSITION ENTRY_TYPE PROGRAM_NAME PROGRAM_LIBRARY_NAME STATEMENT_IDENTIFIERS MODULE_NAME MODULE_LIBRARY_NAME PROCEDURE_NAME ACTIVATION_GROUP_NUMBER ACTIVATION_GROUP_NAME MI_INSTRUCTION_NUMBER 190936/USR001/QPADEV0003 INT 126 USER 24 ILE QRNXIO QSYS 63 QRNXWSIO QBUILDSS1 _QRNX_WS_EXFMT 2 *DFTACTGRP 190936/USR001/QPADEV0003 INT 126 USER 23 ILE PGM001 LIBPGM 74400 PGM001 QTEMP PGM001 2 *DFTACTGRP 190936/USR001/QPADEV0003 INT 126 USER 19 OPM PGM000 LIBPGM 600 15 ---
Casi in cui può essere utile:
- conoscere quali Programmi vengono utilizzati e quali no
- conoscere quali Utenti utilizzano determinati Programmi
- conoscere in quali giorni / orari vengono utilizzati determinati Programmi.