List the spool files for a job

You can use this operation to list the spool files for a batch job on z/OS.

HTTP method and URI path

GET /zosmf/restjobs/jobs/<jobname>/<jobid>/files
GET /zosmf/restjobs/jobs/<correlator>/files
where:
  • /zosmf/restjobs/jobs/ identifies the z/OS® jobs REST interface.
  • <jobname>/<jobid> identifies the job for which the spool files are to be listed. Use either the job name and job ID combination or the job correlator to identify the job.
  • <correlator> identifies the job for which the spool files are to be listed. Use either the job name and job ID combination or the job correlator to identify the job.

    To use a job correlator on this request, specify the full job correlator for the job: The 31-byte system portion, a semicolon, and the user portion (up to 32 bytes). The correlator can be one that you have obtained from the "job-correlator" property in a returned JSON job document. Alternatively, you can specify the complete URL as provided in the "url" property of a JSON job document.

  • /files indicates that the request is to list the spool files for the specified job.

Custom headers

None.

Query parameters

None.

Required authorizations

See Required authorizations.

Usage considerations

See Usage considerations for the z/OSMF REST services.

In addition, note that this request can be directed to a secondary JES subsystem. To do so, use the following URL format:
https://host:port/zosmf/restjobs/jobs/-JESB/jobname/jobid/files
where JESB is the name of the secondary JES subsystem. A request to a secondary JES subsystem must include the job name and job id, rather than a job correlator.

Expected response

On completion, the z/OS jobs REST interface returns an HTTP response with an array of zero or more JSON job file documents. For the contents, see Job file document.

For errors, z/OS jobs REST interface returns an appropriate HTTP status code and error information as a JSON error report document. See Error report document.

Example request

The following request lists the spool files for the job TESTJOB1, job ID JOB00023:
GET /zosmf/restjobs/jobs/TESTJOB1/JOB00023/files HTTP/1.1

Example response

A sample response is shown in Figure 1.
Figure 1. Example: Returned list of spool files
HTTP/1.1 200 OK
Date: Thu, 17 Jan 2013 05:39:28 +0000GMT
Content-Type: application/json
Connection: close

[
{"jobid":”JOB00023”,"jobname":"TESTJOB1",”subsystem”:null,"id":1,
"stepname":"JESE",”procstep”:null,"class":"H",
"ddname":"JESMSGLG",“record-count”:14,"byte-count":1200,
"records-url":"https:\/\/host:port\/zosmf\/restjobs\/jobs\/TESTJOB1\/JOB00023\/1/records"},
{"jobid":”JOB00023”,"jobname":"TESTJOB1",”subsystem”:null,"id":2,
"stepname":"JESE",”procstep”:null,"class":"H",
"ddname":"JESJCL",“record-count”:10,"byte-count":526,
"records-url":"https:\/\/host:port\/zosmf\/restjobs\/jobs\/TESTJOB1\/JOB00023\/2/records"},
{"jobid":”JOB00023”,"jobname":"TESTJOB1",”subsystem”:null,"id":3,
"stepname":"JESE",”procstep”:null,"class":"H",
"ddname":"JESYSMSG",“record-count”:14,"byte-count":1255,
"records-url":"https:\/\/host:port\/zosmf\/restjobs\/jobs\/TESTJOB1\/JOB00023\/3/records"},
{"jobid":”JOB00023”,"jobname":"TESTJOB1",”subsystem”:null,"id":4,
"stepname":"STEP57","procstep":"COMPILE","class":"H",
"ddname":"SYSUT1","record-count":6,"byte-count":741,
"records-url":"https:\/\/host:port\/zosmf\/restjobs\/jobs\/TESTJOB1\/JOB00023\/4/records"},
{"jobid":”JOB00023”,"jobname":"TESTJOB1",”subsystem”:null,"id":5,
"stepname":"STEP57","procstep":"COMPILE","class":"A",
"ddname":"SYSPRINT","record-count":3,"byte-count":209,
"records-url":"https:\/\/host:port\/zosmf\/restjobs\/jobs\/TESTJOB1\/JOB00023\/5/records"}
]