The OPSPDS function performs various 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 extra information.
Note: Use the OPSPDS function in OPS/REXX programs only. OPSPDS cannot be used in AOF rules.
OPSPDS has the following format:
var = OPSPDS(RequestCode,DataSetName|DDName,MemName|StemName)
The following possible function arguments describe the type of operation that OPSPDS performs:
Specifies the operation to be performed on a PDS. The possible values are:
Determines if the member name (MemName) exists as a member in the PDS or in a DDName concatenation as defined by the DataSetName or DDName argument.
Deletes the member (MemName) in the PDS specified by DataSetName.
Reads the PDS directory or the first PDS in a DDName allocation and returns the list of all the member names in a series of stem variables.
Note: Specify the request code as an uppercase text string. Mixed-case text strings may not be supported in the future. Extra OPSPDS request codes are designated for internal CA use only. Use only the request codes that are documented here.
Defines the valid partitioned data set name (PDS or PDSE). A data set name must meet the IBM naming restrictions for PDS data set names, PDSE data set names, or both.
Limits: 1-44 characters
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 © 2014 CA Technologies.
All rights reserved.
|
|