Previous Topic: Values ReturnedNext Topic: Values Returned


OPSPDS Function

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:

RequestCode

Specifies the operation to be performed on a PDS. The possible values are:

EXISTS

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.

DELETE

Deletes the member (MemName) in the PDS specified by DataSetName.

READDIR

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.

DataSetName

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

DDName

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.

MemName

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.

StemName

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.