FOR1440S
The OPEN statement could not connect unit unit-number to file-name. The STATUS specifier had a value of SCRATCH, but the file definition referred to a file or device that is restricted to input only.

Explanation

The STATUS specifier had a value of SCRATCH, which implied that a temporary file was to be created and that output statements, such WRITE or ENDFILE, would be executed. However, the file definition (DD statement or ALLOCATE command) or the data set name given in the FILE specifier on the OPEN statement referred to a file or device that doesn't allow output operations. Examples of such files include:
  • An in-stream data set (DD *)
  • A data set whose DD statement specifies LABEL=(,,,IN)
  • A file for which the system's access control facility (such as RACF®) prevents you from updating the data set

System action

The unit is no longer connected to a file. If neither the ERR nor the IOSTAT specifier is present on the I/O statement, the condition is signaled. If the condition is unhandled, the application is terminated.

Qualifying Data: Only the basic set of four qualifying data for I/O conditions as shown in Table 1. Within this basic set, statement has a value of READ, and parm_count has a value of 4.

Permissible Resume Actions:

Name Action Taken after Resumption
RN The OPEN statement is not completed, and execution continues.

Programmer response

Ensure that the value of the STATUS specifier is consistent with the capabilities of the file or device referenced by the file definition (DD statement or ALLOCATE command) or by the data set name given in the FILE specifier on the OPEN statement. You might have to change either the STATUS specifier, the file definition, or the data set name.

If you want to read from a file or a device that doesn't permit output, either remove the STATUS specifier or change its value to OLD. Ensure that the file really exists and that you can read from it.

If you want to create a temporary file and write records on it, then the value of SCRATCH for the STATUS specifier is correct. In this case, ensure that the file definition refers to a file or device on which you can write records. Note that when the STATUS specifier has a value of SCRATCH, you must omit the FILE specifier.

If you want to create a new file that is other than a temporary file, either remove the STATUS specifier or change its value to NEW or REPLACE. The value of REPLACE allows you to create a new file if it doesn't already exist or to delete an existing one and create a new one.

If you want to overwrite the records in an existing file, either remove the STATUS specifier or change its value to OLD. Unless you specify either a value of APPEND for the POSITION specifier, the DISP=MOD parameter in the DD statement, or the MOD specifier in the ALLOCATE command, the file will be positioned to the beginning and the first WRITE statement will overwrite any existing records.

In any of the cases for which a file is to be created or records are to be written, ensure that the file definition refers to a file or device on which you can write records. For example, don't refer to a data set such as an in-stream data set (DD *), a data set for which you don't have RACF authority to update, or a data set whose DD statement has a LABEL=(,,,IN) parameter.

Symbolic Feedback Code

FOR1440