2 Replies Latest reply on Nov 24, 2018 10:56 AM by Catia Lindo

    CONTROL-M CTMAPI - Force JOB A if JOB B is not in AJF

    Catia Lindo
      Share This:

      Hello,

      I recently started to try out the functionalities of the utility CTMAPI and I wanted to know if it is possible to force JOB A if JOB B is not in AJF.

      I've tried to use ORDER with the IF selection-criteria but it doesn't seem to work.

       

      JCL:

       

      //**********************************************************************

      //CTMAPI EXEC  PGM=CTMAPI,REGION=0M                                  

      // INCLUDE MEMBER=&IOAENV                                      

      //SYSPRINT DD SYSOUT=&OUT                                              

      //SYSOUT   DD SYSOUT=&OUT                                              

      //DAPRINT  DD SYSOUT=&OUT                                              

      //SYSUDUMP DD SYSOUT=&OUTDUMP                                          

      //DAAPI    DD DDNAME=SYSIN                                             

         ORDER DSN=My_Sched_Lib MEMBER=My_Table JOB=JOB_A, -     

            ODATE=%%IODATE FORCE IF (MEM=JOB_B AND STATUS=NOTEXIST)                                               

      //

      //**********************************************************************

       

      Can I actually do what I want with the CTMAPI? How do I pass the value, if possible, of a SEARCH or AJF instruction to another instruction in the same SYSIN.

      That is, imagine I had a SEARCH instruction (SEARCH MEM=JOB_B STATUS=EXIST) and that it returned C0004 for the JOB_B does not exist in AJF , could I pass this to an IF?

       

      Something like:

      SEARCH MEM=JOB_B STATUS=EXIST = C0004 ORDER DSN... FORCE...

       

       

      Thank you!