FILECLOSE= Data Set Option: z/OS

Specifies how a tape is positioned when a SAS data set is closed.
Valid in: DATA step, PROC steps
Category: Miscellaneous
Default: Current setting of the TAPECLOSE system option
Engine: V5TAPE, V6TAPE, V9TAPE
See: FILECLOSE= Data Set Option in SAS Data Set Options: Reference

Syntax

FILECLOSE=DISP | LEAVE | REREAD | REWIND | FREE

Required Arguments

DISP
specifies that the operating system position the tape volume in accordance with the termination disposition specified via the DISP parameter when the library data set was allocated. If the disposition is PASS, the action described for FILECLOSE=LEAVE is performed. For other dispositions, the action described for FILECLOSE=REWIND is performed, and in some cases, the tape volume can be unloaded if necessary.
LEAVE
specifies that the operating system leave the tape volume positioned immediately following the end of the data set on the current volume when SAS closes the library data set. Specifying FILECLOSE=LEAVE is recommended if the subsequent data set on the tape volume is the next data set from that volume that SAS will process. For more information about the LEAVE parameter, see the example in Optimizing Performance.
REREAD
specifies that the operating system rewind the tape volume to the start of the SAS library when SAS closes the library data set. Specifying FILECLOSE=REREAD is recommended if the library will be processed by multiple SAS procedures or DATA steps in the same SAS session.
REWIND
specifies that the operating system rewind the tape volume to the beginning of the tape when SAS closes the library data set.
FREE
specifies that the operating system deallocate the tape volume when SAS closes the library data set. Specifying this option makes the tape volume available for use by other jobs in the system as soon as SAS has closed the library, rather than at the end of the SAS session. Do not specify FILECLOSE=FREE if the library data set will be used in multiple SAS procedures or DATA steps in the same SAS session.

Details

In general, SAS closes the library data set at the conclusion of the SAS procedure or DATA step that is processing the library. The FILECLOSE option has no effect on processing direct bound libraries or UFS libraries. Specifying FREE=CLOSE on the JCL DD statement for a library will be honored only if FILECLOSE has a value of REWIND, DISP, or FREE. If FILECLOSE has a value of REREAD or LEAVE, the FREE=CLOSE specification will be ignored. For more information about FREE=CLOSE, see the IBM JCL Reference for the version of z/OS that your site is using.
Note: If the FILECLOSE data set option is specified, then it overrides the TAPLECLOSE system option.