Previous Topic: Actions OPSVALUE TakesNext Topic: Utilization Environments


Examples: OPSVALUE

Review the following examples for a better understanding of OPSVALUE:

enqsys = OPSINFO('MSFID'); vrc=0 /* Get our sysid */ enqnew = 'HELD BY' userid 'ON' enqsys /* New value for enqueue */ if sysid <> '' then do /* Remote resource? */ Address 'OPSCTL' "MSF DEFAULT SYSTEM("sysid")" /* Xsys request*/ enqsys = sysid /* Sysid for variable name */ end enqvar = 'GLVTEMP0.ENQ.'enqsys'.'resource /* ENQ variable name */ do i=1 to 100 while vrc=0 /* Try 100 times or works */ enqold = OPSVALUE(enqvar,'V') /* Get current ENQ value */ if enqold = '' | enqold = enqvar then /* If ENQ is free */ vrc = OPSVALUE(enqvar,'C',enqnew,enqold) /* Grab ENQ */ else rc = OPSWAIT(1) /* Wait a little and retry */ end if sysid <> '' then /* Reset Xsys environment */ Address 'OPSCTL' "MSF DEFAULT SYSTEM(*)" if vrc = 0 then /* Test ENQ obtained */ say 'Enqueue of' enqsys'.'resource 'failed. enqold /* Failure */ else deqlist = deqlist enqvar /* Save var name for DEQ */

xrc = OPSCLEDQ() /* Clear EDQ */ vcnt = OPSVALUE('GLOBALA.TEST.','T') /* Get data on subnodes */ do i=1 to vcnt while QUEUED() > 0 /* Loop thru subnode data */ pull varname /* First record is name */ pull vardata /* Second is data record */ if WORD(vardata,12) = 'NONE' then /* Real old variable */ vardate = 19900101 /* Set to ancient date */ else /* Get data as yyyymmdd */ vardate = SPACE(TRANSLATE(WORD(vardata,12),' ','/'),0) if DATE('B') - DATE('B',vardate,'S') > 365 then /* Not used? */ rcnt = OPSVALUE(varname,'R') /* Delete var + subnodes */ end

val = OPSVALUE('GLOBALA.TEST.','D') /* Delete all subnodes */

sec = OPSVALUE('GLOBAL.READWRITE','H') /* Request update auth */ if sec <> 'AUTH' then sec = OPSVALUE('GLOBAL.READONLY','H') /* Try read only auth */

OPSVASRV() Function

The OPSVASRV() function creates and manipulates sysplex variables that are defined in the CA CCS Common Variable Service component (CAVARSRV). These variables are independent from the standard CA OPS/MVS global variables. Currently these sysplex variables are only stored in main storage of the CCS CAVARSRV component. This CCS CAVARSRV component is active on each system within the sysplex, providing a tool to any CA OPS/MVS automation that needs to store and manipulate data within the boundaries of a sysplex through this OPSVASRV() function. As long as one system in the sysplex remains active, the variables that are created through this OPSVASRV() function within any CA OPS/MVS automation on any system, continue to exist across system IPLs.