search cancel

Executing SSM LOAD via REXX

book

Article ID: 229200

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

Can SSM LOAD to load a task to SSM be executed via REXX.

 

Environment

Release : 13.5 and above

Component : OPS/MVS

Resolution

For the SSM entry update/insert with OPS/MVS and Rexx, use the ADDRESS SQL..
There is some documentation on this..
See https://techdocs.broadcom.com/us/en/ca-mainframe-software/automation/ca-ops-mvs-event-management-and-automation/14-0/using/using-ca-ops-mvs/using-the-relational-data-framework/storing-data-in-and-requesting-data-from-relational-tables.html

It gives the INSERT statements and other actions that can be take..

To VERIFY and LOAD the policy into the SSM tables, use this Rexx code:

gblpoltbl = 'SSM_PROD_POL'                  /* active policy table */

statetbl=opsinfo('statemantable')
Address SQL
"Select managed_table into ssmtbl from" statetbl
Do t = 1 to ssmtbl.0
  "Select name into resname from "ssmtbl.t
/*-------------------------------------------------------------------*/
/* Unload any resource in ssm table that is not in the active policy */
/*-------------------------------------------------------------------*/
  Do i = 1 to resname.0
    "Select name from "gblpoltbl" Where name = '"resname.i"'" ,
    "And ssmtable = '"ssmtbl.t"'"
    If sqlcode = 100 Then Do                     /* unload it */
      call SSMRESUL(gblpoltbl resname.i ssmtbl.t 0)
      parse var result lrc lmsg
      say 'rc =' lrc  lmsg
    End  /*then*/
  End  /*do i*/
End  /*do t*/

/*********************************************************************/
/* load resources in new policy                                      */
/*********************************************************************/
  "Select name ssmtable from "gblpoltbl
  If sqlcode = 0 Then
    Do i = 1 to name.0
      call SSMRESEX(gblpoltbl name.i ssmtable.i X 0 inall)
      parse var result lrc lmsg
      say 'rc =' lrc  lmsg
    End  /*do*/
  Else
    Say 'no resources found in policy:' gblpoltbl
Exit