Previous Page | Next Page

SAS Component Language Dictionary


Opens an external file
Category: External File

See Also




contains the identifier for the file, or 0 if the file could not be opened.

Type: Numeric


is the fileref that is assigned to the external file.

Type: Character


specifies the type of access to the file:


APPEND mode, which allows writing new records after the current end of the file.


INPUT mode, which allows reading only. (This is the default.)


OUTPUT mode, which defaults to the OPEN mode specified in the host option in the FILENAME statement or function. If no host option is specified, it allows writing new records at the beginning of the file. If the file exists, its contents are overwritten, destroying any previous contents. If the file does not exist, it is created.


Sequential input mode, which is used for pipes and other sequential devices such as hardware ports.


UPDATE mode, which allows both reading and writing records.


Sequential output mode, which is used for pipes and other sequential devices such as hardware ports.

Type: Character


is the logical record length of the file. To use the existing record length for the file, either specify a length of 0 or do not provide a value here.

Type: Numeric


is the record format of the file. To use the existing record format, do not specify a value here.


The data is to be interpreted as binary data.


Use the default record format.


Use an editable record format.


The file contains fixed-length records.


The file contains printer carriage-control characters in a host-dependent record format.


The file contains variable-length records.

Type: Character


Use OUTPUT mode with care.

Opening an existing file in OUTPUT mode overwrites the current contents of the file without warning.  [cautionend]

The FOPEN function opens an external file for reading or updating and returns a file identifier value that can then be used to identify the open file to other functions. You must associate a fileref with the external file before calling the FOPEN function.

In SCL you can assign filerefs by using either the FILENAME statement or the FILENAME function. Under some operating systems, you can also use operating system commands to assign filerefs.

Operating Environment Information:   z/OS

For z/OS data sets that have the VBA record format, specify `P' for the record-format argument.  [cautionend]


See Also






Previous Page | Next Page | Top of Page