Dear Philippe
I hope this IBM Technote may give you some idea : Useful queries to display information not provided on AJS interfaces at https://www.ibm.com/support/pages/useful-queries-display-information-not-provided-ajs-interfaces
===========
These are some queries that can be ran over the AJS files to pull specific data that you can't get by using basic AJS commands:
1) Determining the user profile for AJS jobs. This could be used when deleting a user profile and trying to determine if that user profile is used to run AJS jobs:
SELECT JMJOB FROM QUSRIJS/QAIJSMST WHERE JMUSER = '<user profile>'
2) Determining which AJS jobs are listed in Management Central:
SELECT * FROM QUSRIJS/QAIJSMST WHERE JMJTYP = '*MC'
3) Query that joins the master file and the command list file listing job name and commands:
SELECT T01.JMJOB, T02.CMCMD, T01.JMGRP, T01.JMSEQ, T01.JMAPPL,
T01.JMSCH, T01.JMTME, T01.JMDTE FROM qusrijs/QAIJSmst T01,
qusrijs/QAIJS1cm T02 WHERE T01.jmjob = T02.cmjob
4) SQL to list job name, run time and date, jobd, jobd library, user, commands, in descending order by run time:
SELECT T01.JMJOB, T01.JMTME, T01.JMDTE, T01.JMJOBD, T01.JMJBDL,
T01.JMUSER, T02.CMCMD FROM qusrijs/QAIJSmst T01, qusrijs/QAIJS1cm
T02 WHERE T01.jmjob = T02.cmjob
ORDER BY T01.JMTME DESC
Same as above except in ascending order by date:
SELECT T01.JMJOB, T01.JMTME, T01.JMDTE, T01.JMJOBD, T01.JMJBDL,
T01.JMUSER, T02.CMCMD FROM qusrijs/QAIJSmst T01, qusrijs/QAIJS1cm
T02 WHERE T01.jmjob = T02.cmjob
ORDER BY T01.JMDTE
5) SQL that lists only jobs that do not have *JOBCTL as the jobd.
SELECT T01.JMJOB, T01.JMJOBD, T01.JMJBDL, T02.CMCMD FROM
qusrijs/QAIJSmst T01, qusrijs/QAIJS1cm T02 WHERE T01.jmjob =
T02.cmjob and T01.jmjobd != '*JOBCTL'
6) SQL to list job name, jobd, jobd library, and commands:
SELECT T01.JMJOB, T01.JMJOBD, T01.JMJBDL, T02.CMCMD FROM
qusrijs/QAIJSmst T01, qusrijs/QAIJS1cm T02 WHERE T01.jmjob =
T02.cmjob
7) SQL to list job name, group, status, jobd, command, and format the last run date to mm/dd/yy:
SELECT T01.JMJOB, T01.JMGRP, T01.JMSTS, T01.JMJOBD, T01.JMJBDL,substr(t02.CMCMD,1,50) as cmcmd,
SUBSTRING(CHAR(JMLRD),3,2) CONCAT '/' CONCAT
SUBSTRING(CHAR(JMLRD),5,2) CONCAT '/' CONCAT
SUBSTRING(CHAR(JMLRD),1,2) AS "Last Run Date", T01.JMLST
FROM QUSRIJS/QAIJSmst T01,
QUSRIJS/QAIJS1cm T02 WHERE T01.jmjob = T02.cmjob
------------------------------
Education is not the learning of facts but the training of the mind to think. -- Albert Einstein.
------------------------------
Satid S.
------------------------------