SAS Component Language Dictionary |
Category: | External File |
Syntax | |
Details | |
Examples | |
See Also |
Syntax |
file-id=FOPEN(fileref<,open-mode<,record-length
<,record-format>>>); |
contains the identifier for the file, or 0 if the file could not be opened.
specifies the type of access to the file:
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.
is the record format of the file. To use the existing record format, do not specify a value here.
'B' | |
'D' | |
'E' | |
'F' | |
'P' |
The file contains printer carriage-control characters in a host-dependent record format. |
'V' |
Details |
Opening an existing file in OUTPUT mode overwrites the current contents of the file without warning.
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.
Examples |
Assign the fileref MYFILE to an external file. Then attempt to open the file for input, using all defaults:
rc=filename('myfile',fname); fid=fopen('myfile');
Attempt to open the file for input, this time not using defaults:
fid=fopen('file2','o',132,'e');
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.