List the members of a z/OS data set

You can use this operation to list the members of a z/OS partitioned data set.

HTTP method and URI path

Start of change
GET /zosmf/restfiles/ds/<dataset-name>/member?start=<member>&pattern=<mem-pat> 
End of change
where:
  • /zosmf/restfiles specifies the z/OS® data set and file REST interface
  • /ds indicates a data set request
  • /<dataset-name> identifies the data set for which members are to be listed. This parameter is required and must consist of a fully qualified data set name. The length of the data set name that you specify on the request cannot exceed 44 characters. You cannot use wildcard characters for this parameter.
  • /member indicates that member names are to be returned.

Standard headers

None.

Custom headers

Include the following custom HTTP headers with this request:
X-IBM-Max-Items
This header value specifies the maximum number of items to return. To request that all items be returned, set this header to 0. If you omit this header, or specify an incorrect value, up to 1000 items are returned by default.
X-IBM-Attributes
This header is optional.Start of change
member
A request that only member names be returned. If you omit this header, it is set to "member".
base
Setting the X-IBM-Attribute to base returns all of the basic attributes for the data set member being queried. These attributes are commonly found in the ISPF List Data set panel. The base key is mutually exclusive with member.
,total
The suffix ,total, can be added to request that the "totalRows" property is returned if more data set members than the maximum requested are available.
End of change
Start of changeX-IBM-Migrated-RecallEnd of change
Start of change
This header is optional; use it to specify how a migrated data set is handled. By default, a migrated data set is recalled synchronously. The following values may be specified too:
wait
This is the default value. If the data set is migrated, wait for it to be recalled before processing the request.
nowait
If the data set is migrated, request it to be recalled, but do not wait.
error
If the data set is migrated, do not attempt to recall the data set.
End of change

Query parameters

Start of change
Start of changestartEnd of change
Start of changeAn optional search parameter that specifies the first member name to return in the response document. The length of the data set name that you specify cannot exceed 8 characters, and cannot contain wildcards. If the member name is not found for the given search, then the next member matching the search is returned. End of change
Start of changepatternEnd of change
Start of changeAn optional search parameter restricts the returned member names to only the names that match the given pattern. The syntax of this argument is the same as "pattern" parameter of the ISPF LMMLIST service. End of change
End of change

Required authorizations

See Required authorizations.

Expected response

On completion, the service returns an HTTP response, which includes a status code indicating whether your request completed. Status code 200 indicates success. A status code of 4nn or 5nn indicates that an error has occurred. For more details, see Error handling.

For a successful request, the HTTP response includes an array of data set members, each as one of the following types of JSON list document:

For errors, the HTTP response includes error information as a JSON error report document. See Error report document.

Start of change

Example request

In the following example, the GET method is used to list all of the members of a data set.
GET /zosmf/restfiles/ds/SYS1.PROCLIB/member HTTP/1.1
End of change
Start of change

Example response

A sample response is shown in List all of the members of a data set.
Figure 1. Example: List all of the members of a data set

Response

200 OK
X-Powered-By: Servlet/3.0
Content-Type: application/json; charset=UTF-8
Content-Length: 235
Content-Language: en-US
Date: Tue, 24 Nov 2015 05:31:51 GMT

Response Body

{"items":[
{"member":"CREATECD"},
{"member":"SPROCLA1"},
{"member":"TESTJCL"},
{"member":"WASACR"},
{"member":"WLMCD"},
{"member":"XRACFH"},
{"member":"XRACFHT"},
{"member":"XRACFH2"}
],"returnedRows":8,"JSONversion":1}
End of change
Start of change

Example request

In the following example, the GET method is used to list all of the members of a data set with specified base attributes.
GET /zosmf/restfiles/ds/SYS1.PROCLIB/member HTTP/1.1

Request Headers:

X-IBM-Attributes: 'base'
End of change
Start of change

Example response

A sample response is shown in List all of the members of a data set with specified base attributes.
Figure 2. Example: List all of the members of a data set with specified base attributes.

Response

200 OK
X-Powered-By: Servlet/3.0
Content-Type: application/json; charset=UTF-8
Content-Length: 1287
Content-Language: en-US
Date: Tue, 24 Nov 2015 05:33:57 GMT

Response Body

{"items":[
{"member":"CREATECD","vers":1,"mod":0,"c4date":"2015/08/12","m4date":"2015/08/12","cnorc":22,
"inorc":22,"mnorc":0,"mtime":"05:48","msec":"43","user":"IBMUSER","sclm":"N"},
{"member":"SPROCLA1","vers":1,"mod":12,"c4date":"2009/10/16","m4date":"2014/09/18","cnorc":132,
"inorc":122,"mnorc":0,"mtime":"07:55","msec":"23","user":"IBMUSER","sclm":"N"},
{"member":"TESTJCL","vers":1,"mod":0,"c4date":"2015/07/29","m4date":"2015/07/29","cnorc":22,
"inorc":22,"mnorc":0,"mtime":"01:49","msec":"36","user":"IBMUSER","sclm":"N"},
{"member":"WASACR"},{"member":"WLMCD","vers":1,"mod":0,"c4date":"2015/08/14","m4date":"2015/08/14",
"cnorc":22,"inorc":22,"mnorc":0,"mtime":"04:44","msec":"19","user":"IBMUSER","sclm":"N"},
{"member":"XRACFH","vers":1,"mod":1,"c4date":"2005/09/26","m4date":"2005/11/03","cnorc":514,
"inorc":506,"mnorc":8,"mtime":"11:10","msec":"45","user":"HDENNIS","sclm":"N"},
{"member":"XRACFHT","vers":1,"mod":0,"c4date":"2005/11/04","m4date":"2005/11/04","cnorc":130,
"inorc":130,"mnorc":0,"mtime":"11:28","msec":"12","user":"HDENNIS","sclm":"N"},
{"member":"XRACFH2","vers":1,"mod":0,"c4date":"2005/11/04","m4date":"2005/11/04","cnorc":130,
"inorc":130,"mnorc":0,"mtime":"11:27","msec":"43","user":"HDENNIS","sclm":"N"}
],"returnedRows":8,"JSONversion":1}
End of change