Format:
b = open(ext-dict-name | file-name[, update | append | create]);
Description:
The open function opens and keeps open an external file or file declared in a file statement.
Under most circumstances, neither an open nor a close function is necessary to manipulate the file. In data entry applications, by default, the file is opened when it is operated on with a file function, such as loadcase, writecase, readfile, or writefile and closed immediately afterward. In batch applications, by default, the file is opened at the beginning of the run and closed at the end.
If you want to control the opening and closing of the file, you can use the open and close functions to do this. If you code an open function anywhere is the application logic, then you must control all opening and closing of the file
The ext-dict-name or file-name must be supplied. Ext-dict-name is the name of a data dictionary defining an external data file. File-name is the name of a file declared in a file statement.
The keywords update, append or create are optional. If no keyword is coded, the file is opened in update mode.
When an ext-dict-name is used, if update or append is used, the file is opened, its contents are not changed, and the file is ready to update cases. If create is coded, the file is opened, all previous records are removed and the file is ready to add cases.
When a file-name is used, if update is used, the file is opened and you are positioned at the beginning of the file. If append is coded, the file is opened, its contents are not changed, and you are positioned at the end of the file. If create is coded, the file is opened, all previous records are removed and you are positioned at the beginning of the file.
Return value:
The function returns a logical value of 1 (true) if file is opened and 0 (false) otherwise.
Example 1:
OK = open(LOOKUP);
Example 2:
OK = open(REPORT, append);