Deleting output descriptors

To delete an output descriptor, use the OUTDEL macro. The results that you get from issuing the OUTDEL macro depend on which JES you are using. If you use the OUTDEL macro in an address space running under JES2 Version 4.1.0 or later, or JES3 Version 4.2.1 or later, the deleted output descriptor's storage is freed before or at step termination. If, however, you issue the OUTDEL macro in an address space running under a version earlier than JES2 4.1.0, the deleted output descriptor's storage is always freed at the end of the job. The details of these different results follow.
OUTDEL is used in an address space running under JES2 Version 4.1.0 or later, or running under JES3 Version 4.2.1 or later
When you delete an output descriptor, the output descriptor is logically removed from the system. The deleted output descriptor's storage is freed before or at step termination. The system frees the output descriptor's storage once all allocated SYSOUT data sets that refer to the output descriptor have been either opened or, if they are never opened, when they are unallocated. If no SYSOUT data sets refer to the output descriptor, the system frees the storage immediately.
OUTDEL is used in an address space running under an earlier version of JES2 than JES2 4.1.0
As in the case above, when you delete an output descriptor, it is logically removed from the system. However, the output descriptor's storage is always freed at the end of the job. If a program creates too many descriptors, it can run out of storage in the address space. Dynamic output cannot reuse the storage that a deleted descriptor occupies. An output descriptor varies in size, depending on the SYSOUT processing options it contains.

Like OUTADD, the OUTPUT JCL statement also creates an output descriptor. If an output descriptor was created by an OUTPUT JCL statement, you cannot delete it by using the OUTDEL macro. If you try to do this, you get return code 4 with reason code 403 hex.

When a program invokes dynamic allocation to allocate a SYSOUT data set, the data set can refer to one or more output descriptors. Although the descriptors must exist before dynamic allocation is invoked, they do not have to exist afterwards. So, you can delete the descriptor immediately after allocating the data set. Deleting the descriptor does not affect the data set, which can exist even though its descriptor is deleted.

A dynamically allocated SYSOUT data set can refer to either a named or a default output descriptor. The dynamically allocated data set refers to a named output descriptor by using the dynamic allocation key, X'8002' (DALOUTPT). By omitting this key, the dynamically allocated data set refers to a default output descriptor. You define the default output descriptors by using the JCL OUTPUT statement with a DEFAULT=YES parameter, or by having a program invoke dynamic output using the text unit key, X‘000B’(DODEFAUL).

If, after the data set is allocated and its descriptor is deleted, you create another descriptor with the same name but with different text unit characteristics, the characteristics of the data set are not changed. The processing options of the data set depend only on the descriptor that was used at allocation time. Also note that, if you unallocate the data set while its output descriptor exists, the descriptor is not affected.

The syntax of OUTDEL allows only a list form and an execute form. To specify the name of the descriptor that is to be deleted, use the execute form.