Release a job

For a job that has been held from execution on z/OS, you can use this operation to release the job. When released, a job is made eligible for selection to execute.

HTTP method and URI path

PUT /zosmf/restjobs/jobs/<jobname>/<jobid>
PUT /zosmf/restjobs/jobs/<correlator>
where:
  • /zosmf/restjobs/jobs/ identifies the z/OS® jobs REST interface.
  • <jobname>/<jobid> identifies the job to be released. Use either the job name and job ID combination or the job correlator to identify the job.
  • <correlator> identifies the job to be released. 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.

Custom headers

None.

Query parameters

None.

Input to this request

  • Internet media type: application/json
  • HTTP request with JSON document containing the following properties:
    “request”:”release”
    Indicates a request to release a job.
    “version”:”n.n
    Specifies the version of the service to be used, either 1.0 or 2.0.

To request asynchronous processing for this service (the default), set the "version" property to 1.0 or omit the property from the request. To request synchronous processing, set "version" to 2.0. If so, the system will attempt to process the request synchronously, if such processing is supported on the target JES subsystem.

For further considerations, see Synchronous support for the job modify operations.

Required authorizations

See Required authorizations.

Usage considerations

See Usage considerations for the z/OSMF REST services.

In addition, observe the following consideration for this request:
  • This request can be directed to a secondary JES subsystem. To do so, use one of the following request formats:
    https://host:port/zosmf/restjobs/jobs/-JESB/jobname/jobid
    https://host:port/zosmf/restjobs/jobs/-JESB/correlator
    
    where:
    • JESB is the name of the secondary JES subsystem.
    • The job to be released is identified by either the job name and job ID (jobname/jobid) or the job correlator (correlator).

Expected response

The response depends on whether the request is processed synchronously or asynchronously, as follows:
  • For an asynchronous request, the caller receives only the HTTP status code 202 ACCEPTED. To determine whether the request was successful, the caller can issue the service described in Obtain the status of a job.
  • For a synchronous request, the caller receives an HTTP status code, which indicates the results of the request, as follows:
    • Status code 200 indicates that the synchronous request was processed successfully. This status, however, does not mean that the operation was successful. To determine the success of the operation, check the "status" property in the JSON job feedback document for a value of 0 (zero). See Job feedback document.
    • Status code of 4nn or 5nn indicates that an HTTP error has occurred.

For errors, z/OS jobs REST interface returns error information as a JSON error report document. See Error report document.

Example request

The following request specifies that the job TESTJOBW, job ID JOB00023, is to be released. With the inclusion of the "version" property set to 2.0, the request is eligible to be processed synchronously, if supported on the target JES subsystem.
PUT /zosmf/restjobs/jobs/TESTJOBW/JOB00023 HTTP/1.1
Host: zosmf1.yourco.com
Content-Length: 40
Content-Type: application/json

{
"request":"release"
"version":"2.0"
}

Example response

A sample response is shown in Figure 1.
Figure 1. Example: Returned results of a job release request
HTTP/1.1 200 OK
Date: Thu, 16 Jan 2014 05:39:28 +0000GMT
Content-Type: application/json
Connection: close

{
"jobid":"JOB00023",
"jobname":"TESTJOBW",
"original-jobid":"JOB00023",
"owner":"IBMUSER"
"member":"JES2",
"sysname":"SY1",
"job-correlator":"J0000023SY1.....CC20F378.......:",
"status":"0"
}