OPS/MVS

 View Only
  • 1.  Get Value of Global Variable in Batch

    Posted Jun 26, 2018 03:12 PM

    Is it possible to get the value of an OPS/MVS Global Variable through a batch process?  An active automation process updates the value of a permanent global variable in OPS/MVS.  Is it possible for a batch job to capture the value of the variable to determine what steps should be executed in the batch job?

     

    Thanks,

     Steve



  • 2.  Re: Get Value of Global Variable in Batch
    Best Answer

    Broadcom Employee
    Posted Jun 26, 2018 07:06 PM

    Hello Steve,

     

    Yes, it is possible. Let's suppose you have a global variable named GLOBAL.RC where you have a numeric return code assigned. So you can create a REXX program as simple as:

     

    EDIT CAI.OPS.REXX(CHKRC) - 01.00
    Command ===>
    ***************************** Top of Data
    retcode = opsvalue('GLOBAL.RC','O')
    exit retcode
     **************************** Bottom of Data

     

    Then create a JCL step to execute this REXX program:

     

    //CMD EXEC PGM=OI,PARM='CHKRC' <- name of the member where the REXX program is
    //STEPLIB DD DISP=SHR,DSN=CAI.OPS130.CCLXLOAD
    //OPS$OPSS DD DUMMY <- OPS subsystem id OPSS
    //SYSPRINT DD SYSOUT=*
    //SYSEXEC DD DISP=SHR,DSN=CAI.OPS.REXX

     

    This step you end with the return code as set in the global variable GLOBAL.RC so that you can use JCL COND or IF statements to control the execution of subsequent steps.

    You may need to include some more code to check if the global variable exists before using it and any other logic required by your application.

     

    Regards,
    Mario

     

    Carlos Mario Filho
    Principal Support Engineer



  • 3.  Re: Get Value of Global Variable in Batch

    Broadcom Employee
    Posted Jun 29, 2018 09:24 AM

    Hi Steve,

     

    Were you able to review and verify the information provided by Mario?



  • 4.  Re: Get Value of Global Variable in Batch

    Posted Jun 29, 2018 04:08 PM
      |   view attached

    Frank,

     

    Yes, the information from Mario was helpful.

     

    Steve