IBM i Global

 View Only
  • 1.  IBM i AJS (Advanced Job Scheduler): list all jobs supposed to run in a given timeframe

    Posted Thu March 23, 2023 09:20 AM

    Next Sunday we are moving to summertime. Meaning all jobs planned to run between 2 and 3 will start together.

    I'm trying to list all jobs that are planned to run in that timeframe. The regular reports lists only the first occurrence a job will run.

    I knew it wasn't possible in the system scheduler, but I was pretty sure it was in the Advanced Job Scheduler. Isn't it?

    Any tool is ok: 5250, Heritage Nav4i, New Nav4i or ACS RSS.



    ------------------------------
    Philippe Vanden Bussche
    ------------------------------



  • 2.  RE: IBM i AJS (Advanced Job Scheduler): list all jobs supposed to run in a given timeframe

    IBM Champion
    Posted Thu March 23, 2023 07:42 PM

    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.
    ------------------------------



  • 3.  RE: IBM i AJS (Advanced Job Scheduler): list all jobs supposed to run in a given timeframe

    IBM Champion
    Posted Fri March 24, 2023 06:45 AM

    Hello Philippe,

    The AJS command PRTSCDJS will achieve what you want. It only limits the selection to the day level, but that does not prevent it from answering your question. 

    Use as shown below:

    PRTSCDJS NBRDAY(*SELECT) SLTDATE(260323 260323)

    I can only hope this helps. 



    ------------------------------
    Rudi Van Helvoirt
    ------------------------------



  • 4.  RE: IBM i AJS (Advanced Job Scheduler): list all jobs supposed to run in a given timeframe

    Posted Mon March 27, 2023 03:32 AM

    Thank you, Rudi.

    This has done the job.



    ------------------------------
    Philippe Vanden Bussche
    ------------------------------



  • 5.  RE: IBM i AJS (Advanced Job Scheduler): list all jobs supposed to run in a given timeframe

    Posted Fri March 24, 2023 09:34 AM

    I have never used/seen AJS.

    But you can query your scheduled job with the following SQL. You'll find there all the info you need.

    select * from qsys2.SCHEDULED_JOB_INFO

    And thank you for the tip. I never thought about this possible issue. I just checked now my own jobs.



    ------------------------------
    Denis Roche
    ------------------------------



  • 6.  RE: IBM i AJS (Advanced Job Scheduler): list all jobs supposed to run in a given timeframe

    IBM Champion
    Posted Fri March 24, 2023 10:39 AM

    Hello Denis,

    The SQL statement in your mail is referring to the WRKJOBSCDE green screen scheduler. AJS is "Advanced", that is the letter A standing for. It is a diffenrent License Program. 

    Please have a look here => https://powerwire.eu/an-advanced-job-scheduler

    In there they tell you more about AJS and that the move to it is for free. No license costs anymore.

    Enjoy :-)



    ------------------------------
    Rudi Van Helvoirt
    ------------------------------