Using spool files in z/OS CICS

EGL programs generated for CICS® for z/OS® can access JES SPOOL files if the serial or print file is associated with the spool file type at generation.

The system resource name for a spool file depends on whether the file is an input or output file:

Input file
Maximum 10–byte name in the format userid.class.
userid
A 4- to 8-character external writer name or an asterisk. If you use an external writer name, CICS requires that the first 4 characters of the external writer name be the same as the first 4 characters of the CICS APPLID used to identify the CICS region to ACF/VTAM.
class
An optional 1-character spool class; the default is "A".
Output file
Maximum 19-byte name in the format nodeid.userid.class.
nodeid
A 1- to 8-character system node ID. You can use an asterisk for nodeid.
userid
A 1- to 8-character system user ID. You can use an asterisk for userid. If you do not specify class, userid is also optional and defaults to the CICS user id (the same value that is stored in sysVar.userID).
class
An optional 1-character spool class; the default is "A".

Refer to the CICS customization manual for more information.

Do not use spool files as temporary files that a program writes to and then reads. You can specify the same resource name for the output and input file, but in this case the resource name represents a destination rather than a specific file. If you write to a spool destination and close the file, the file might not be immediately available for input file from that destination and might be queued behind other files sent to the same destination.

For more information on spool file access in CICS, refer to the CICS customization manual.

Spool files are opened on first access and closed in one of the following circumstances:

Feedback