ATMP_RESPONSE parameter in DFHATOMPARMS container
The ATMP_RESPONSE parameter is the address of a double word that you use to return a response code to CICS indicating success or error. If the service routine sends a response code indicating an error, CICS produces a suitable default HTTP error response to send to the web client. The service routine can use the DFHHTTPSTATUS container to return an alternative status code and text to override the default error response.
Do not change the address of the double word. The first fullword, ATMP_RESPONSE_CODE, contains the response code. It is initialized to zero, indicating successful completion. The second fullword, ATMP_REASON_CODE, is also initialized to zero, and the service routine must not change this fullword; it is reserved for future use.
atmp_resp_normal constant(0); ! Normal success response
atmp_resp_not_found constant(4); ! Resource not found
atmp_resp_not_auth constant(8); ! Resource not authorized
atmp_resp_disabled constant(12); ! Resource is disabled
atmp_resp_already_exists constant(16); ! Resource already exists
atmp_resp_etag_no_match constant(20); ! If-Match compare failed
atmp_resp_invalid_request constant(24); ! Request not valid
atmp_resp_access_error constant(32); ! Other resource error
atmp_resp_conversion_failed constant(36); ! XML Conversion error | ATMP_RESPONSE_CODE value | HTTP status code | HTTP status text |
|---|---|---|
atmp_resp_normal |
200 (201 for POST requests) | OK (For POST requests, Created) |
atmp_resp_not_found |
404 | Not found |
atmp_resp_not_auth |
403 | Forbidden |
atmp_resp_disabled |
503 | Service unavailable |
atmp_resp_already_exists |
409 | Duplicate resource |
atmp_resp_etag_no_match |
412 | Precondition failed |
atmp_resp_invalid_request |
400 | Invalid request |
atmp_resp_access_error |
500 | Resource error |
atmp_resp_conversion_failed |
500 | Resource error |
When the service routine returns an error, it can use the DFHHTTPSTATUS container to return an alternative status code and text to replace the default HTTP error response. For a listing of status codes that you might want to use in your error responses, see HTTP status code reference for CICS web support. You cannot override the default HTTP response for a successful request (with a zero response code).