SET FILE DISABLED

Makes a file unavailable to application programs.

Syntax

SET FILE

Read syntax diagramSkip visual syntax diagramSET FILE( data-value)DISABLEDWAITNOWAITFORCE

Condition: FILENOTFOUND, INVREQ, NOTAUTH

Note: DSIDERR is equivalent to FILENOTFOUND.

 

Description

SET FILE DISABLED allows you to disable a local file, thereby making it unavailable to application programs. The WAIT and NOWAIT options provide synchronous and asynchronous operations respectively.

Options

FILE(data-value)
Specifies the name of the file as defined in the File Definitions (FD). The name can be up to eight characters long.
FORCE
All tasks that are using the file are abended, the file is immediately DISABLED or CLOSED, and control returns to the issuing application. It is recommended that the use of the FORCE option be restricted to exceptional circumstances. Data integrity is not guaranteed when the FORCE option is used, and depending on what tasks are currently processing, it is possible for CICS® to terminate abnormally.
Note: Using the FORCE option to close a file can cause immediate termination of users' tasks to occur through the CICS task FORCEPURGE mechanism. Data integrity is not guaranteed with this mechanism. In some extreme cases, for example, if an error occurs during backout processing, CICS can terminate abnormally. For this reason, restrict file closing through the use the FORCE option to exceptional circumstances.
NOWAIT
This option acts in the same way as the WAIT option does, except that CICS returns control to the application when the SET FILE DISABLED request has been queued.
WAIT
Specifies that CICS is to wait until all activity on the file has quiesced before setting the file DISABLED and finally returning control to the application. The WAIT option is the default.

Conditions

FILENOTFOUND
Occurs if the named file cannot be found in the FD.

Default action: Terminates the task abnormally (RESP2=18).

INVREQ
Occurs for the following conditions, depending on the options that are specified on the SET FILE DISABLED command:
  • The file is remote (RESP2=1).
  • The file is in use within the current LUW (RESP2=21).

Default action: Terminates the task abnormally.

NOTAUTH
Occurs if a resource security check has failed on FILE(name).

Default action: Terminates the task abnormally.