1 Reply Latest reply on Feb 18, 2020 8:59 PM by Paul Robins

    Control-m on parameters using if staement on Z/OS(JCL)

    Itai Cohen
      Share This:



      I'm running control-m under z/os.

      I want to get different parameters according to the RC of the steps before.

      How do i do that?


      I need something like

      PGM1 exec....

      If PGM1.rc=0

         %%B = LastMonth

         %%C = LastYear


         %%B = CurrentMonth

         %%C = CurrentYear


      PGM2 exec......




      Thank you.

        • 1. Re: Control-m on parameters using if staement on Z/OS(JCL)
          Paul Robins

          Hi Itai, how did you go with this. I had a play around with the hope of helping but wasn't able to get it working before I ran out of time.


          I was going for something like this but it didn't work:


          //STEP01   EXEC IOATEST                     

          //SYSIN     DD *                            



          //TEST  IF (STEP01.IOATEST.RC = 0) THEN     

          //* %%SET %%A = %%$CALCDTE %%$ODATE -%%ODAY 

          //* %%SET %%B = %%SUBSTR %%A 5 2            

          //* %%SET %%C = %%SUBSTR %%A 1 4            

          // ELSE                                     

          //* %%SET %%B = %%OMONTH                    

          //* %%SET %%C = %%$OYEAR                    

          // ENDIF                                    


          //STEP02   EXEC IOATEST                     

          //SYSIN     DD *                            

          WTO=B %%B C %%C