Understanding allocation errors

The IMS Spool API interface defers dynamic allocation of the print data set until data is actually inserted into the data set. Incorrect data set print options on the CHNG or SETO call can cause errors during dynamic allocation. The print data set options can be parsed during the processing of the CHNG and SETO calls but some things, for example the destination name parameter, can be validated only during dynamic allocation.

If one of the print options is incorrect and dynamic allocation fails when the IMS performs the first insert for the data set, IMS returns a AX status code to the ISRT call. IMA also issues message DFS0013E and writes a diagnostic log record (67D0) that you can use to evaluate the problem. The format of the error message indicates the type of service that was invoked and the return and reason codes that were responsible for the error. The error message can indicate these services:
DYN
MVS dynamic allocation (SVC99)
OPN
MVS data set open
OUT
MVS dynamic output descriptors build (SVC109)
UNA
MVS dynamic unallocation (SVC99)
WRT
MVS BSAM write

If the DFS0013E message indicates an error return code from any of these services, you should consult the corresponding MVS documentation for more information on the error code. If the service is for dynamic allocation, dynamic unallocation, or dynamic output descriptor build, see z/OS® MVS Programming: Authorized Assembler Services Guide for the appropriate return and reason codes.

One common mistake is the use of an invalid destination or selection of integrity option 2 (non-selectable destination) when the destination of IMSTEMP has not been defined to JES. If you specify an invalid destination in the destination name parameter, the call will result in a dynamic unallocation error when IMS unallocates the print data set.