Previous Topic: Sample Output from OPSTATUSNext Topic: OPSUBMIT Function


OPSTORE Function

The OPSTORE function returns a character string of the specified length that contains a copy of the virtual storage at the specified address.

The only func value that is supported is S for Storage.

Note: The OPSTORE function can be used in OPS/REXX or AOF rules.

OPSTORE has the following format:

var = OPSTORE(func,address,length)
address

Address can be any virtual storage address in the home address space. When a REXX program runs in an APF-authorized environment, all virtual storage locations in the home address space can be accessed. Under usual circumstances, only production (not test) AOF rules run as APF-authorized. However, CA OPS/MVS TSO command processors that have been added to the TSO authorization tables are an exception to this rule. When a REXX program running in a non-APF-authorized environment invokes the OPSTORE function to access fetch-protected storage, a zero-length result is returned.

length

The length argument can be any non-negative integer value up to 256 (inclusive). This argument specifies the length of the virtual storage data to be returned in the result character string.

Examples: OPSTORE

The following examples illustrate the OPSTORE function:

Example 1

To display the address of the CVT, issue the OPSTORE function as follows:

CVT=OPSTORE(S,'10'X,4)
SAY C2X(CVT)

Example 2

The following REXX EXEC can be executed with OPS/REXX or TSO/E REXX. It shows the differences between the OPS/REXX OPSTORE function and the TSO/E REXX STORAGE function:

/* REXX */
parse source rexxtype .
if rexxtype == "OPS/REXX" then
  do
    CVT      = OPSTORE("S",'10'x,4)
    asvt     = OPSTORE("S",D2C(C2D(CVT) + 556),4)
    asvtnonr = C2D(OPSTORE("S",D2C(C2D(asvt) + 488),4))
    asvtanr  = C2D(OPSTORE("S",D2C(C2D(asvt) + 496),4))
  end
else
  do
    CVT      = C2D(STORAGE(10,4))
    asvt     = C2D(STORAGE(D2X(CVT + 556),4))
    asvtnonr = C2D(STORAGE(D2X(asVT + 488),4))
    asvtanr  = C2D(STORAGE(D2X(asVT + 496),4))
  end

say "asvtnonr = "asvtnonr
say "asvtanr  = "asvtanr

result = asvtanr - asvtnonr