Opens an external file and returns a file identifier value.
Category: | External Files |
See: | FOPEN Function: z/OS in SAS Companion for z/OS |
is a character constant, variable, or expression that specifies the fileref assigned to the external file.
Tip | If fileref is longer than eight characters, then it will be truncated to eight characters. |
is a character constant, variable, or expression that specifies the type of access to the file:
A | APPEND mode allows writing new records after the current end of the file. |
I | INPUT mode allows reading only (default). |
O | OUTPUT mode defaults to the OPEN mode specified in the operating environment option in the FILENAME statement or function. If no operating environment option is specified, it allows writing new records at the beginning of the file. |
S | Sequential input mode is used for pipes and other sequential devices such as hardware ports. |
U | UPDATE mode allows both reading and writing. |
Default | I |
is a numeric constant, variable, or expression that specifies the logical record length of the file. To use the existing record length for the file, specify a length of 0, or do not provide a value here.
is a character constant, variable, or expression that specifies the record format of the file. To use the existing record format, do not specify a value here. Valid values are:
B | data are to be interpreted as binary data. |
D | use default record format. |
E | use editable record format. |
F | file contains fixed length records. |
P | file contains printer carriage control in operating environment-dependent record format. Note: For z/OS data sets with FBA or VBA record format, specify 'P' for the record-format argument. |
V | file contains variable length records. |
%let filrf=myfile;
%let rc=%sysfunc(filename(filrf,
physical-filename));
%let fid=%sysfunc(fopen(&filrf));