Chapter Contents |
Previous |
Next |
FOPEN |
Category: | External File |
Syntax | |
Details | |
Examples | |
Example 1: no-title for topic with id=z1124207 | |
See Also |
Syntax |
file-id=FOPEN(fileref<,open-mode<,record-length
<,record-format>>>); |
Type: Numeric
Type: Character
'A' |
APPEND mode, which allows writing new records after the current end of the file. |
'I' |
INPUT mode, which allows reading only. (This is the default.) |
'O' |
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. |
'S' |
Sequential input mode, which is used for pipes and other sequential devices such as hardware ports. |
'U' |
UPDATE mode, which allows both reading and writing records. |
'W' |
Sequential output mode, which is used for pipes and other sequential devices such as hardware ports. |
Type: Character
Type: Numeric
'B' |
The data is to be interpreted as binary data. |
'D' |
Use the default record format. |
'E' |
Use an editable record format. |
'F' |
The file contains fixed-length records. |
'P' |
The file contains printer carriage-control characters in a host-dependent record format. |
'V' |
The file contains variable-length records. |
Details |
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: OS/390
For OS/390 data sets that have the VBA record format, specify `P' for the record-format argument.
Examples |
rc=filename('myfile',fname); fid=fopen('myfile');
fid=fopen('file2','o',132,'e');
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.