The OPSPDS function performs a variety of operations on partitioned data sets (PDS) and returns a numeric string value that is used to determine the success of the operation. In some cases it creates REXX stem variables containing additional information.
Note: You can only use the OPSPDS function in OPS/REXX programs. It cannot be used in AOF rules.
This function has the following format:
var = OPSPDS(RequestCode,DataSetName|DDName,MemName|StemName)
The function arguments describe the type of operation that OPSPDS performs. Possible arguments are:
Specifies the operation to be performed on a PDS. The possible values are:
Note: The request code should be specified as an upper case text string. Mixed case text strings may or may not be supported in the future. There are additional OPSPDS request codes designated for internal CA use only. Do not use any request code other than those documented here.
Defines the valid partitioned data set name (PDS or PDSE). A data set name can be from 1 to 44 characters in length and must meet the IBM naming restrictions for PDS and/or PDSE data set names. For example: SYS1.LINKLIB
Specifies a DDName for the EXISTS and READDIR request codes. You may use the DDName as an alternative to specifying a partitioned data set name. The DELETE request code will only work with a partitioned data set name.
Note: In the case of READDIR, only members in the partitioned data set at the top of a DDName concatenation are returned.
Specifies the member name for the EXISTS and DELETE request codes. The OPSPDS function supports 1- to 8-character member names that do not contain periods (.) and do not start with leading numeric digits. While it is possible through programmatic means to create member names that do not meet these restrictions, this is what OPSPDS supports.
Specifies a stem name for the READDIR function. The stem can be from 1 to 32 characters including an optional trailing period and must conform to the standard REXX rules for stem names. If a period is not provided, one is appended to the end of the stem name value. The stem cannot be a global variable stem of any kind.
Example: Using OPSPDS
These examples show how to verify, delete, and list members.
Opspdsrc = OPSPDS('EXISTS','OPSMVS.MY.RULES','RULE1')
Assuming that OPSMVS.MY.RULES is a valid partitioned data set, the result string is 0 if the member exists or 16 if the member does not exist.
Opspdsrc = OPSPDS('DELETE','MY.REXX','REXXPGM1')
Assuming that MY.REXX is a valid partitioned data set, the result string is 0 if the member is successfully deleted or 16 if the member does not exist.
Opspdsrc = OPSPDS('READDIR','MY.PDS','PDSVAR.')
Assuming that MY.PDS is a valid partitioned data set, the result string is 0 and variable PDSVAR.0 contains an integer value indicating how many additional stem variables of the type PDSVAR.1, PDSVAR.2, and so on, have been created containing the list of member names.
FRC = OPSDYNAM(“ALLOC DD(MYREXX) DSN(‘OPSMVS.MY.REXX’) SHR VOL(TSU001) UNIT(3390) ”)
Opspdsrc = OPSPDS('EXISTS','MYREXX’,'REXX1')
The uncataloged data set is allocated to the DDName MYREXX. You can then use OPSPDS to determine the existence of member REXX1 within OPSMVS.MY.REXX using the DDName instead of the data set name. Assuming that OPSMVS.MY.REXX is a valid partitioned data set, the result string is 0 if the member exists or 16 if the member does not exist.
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |