Chapter Contents |
Previous |
Next |
SAS Component Language: Reference |
When you open an external file, a unique identifier is assigned to the external file. This identifier is used by any other SCL functions that manipulate the file. In addition, a temporary storage buffer is automatically created for the external file. This storage area is used to store copies of file records.
The FOPEN function returns the program's identification number for that file. This unique number is called the file identifier. You use this identifier by storing it in an SCL variable and passing the variable name as an argument to all the SCL functions that manipulate that file or directory. This technique enables you to open and manipulate multiple files at the same time and to clearly identify which file to manipulate.
When you open a file, you specify an open mode. The open mode determines the actions that can be performed on the file. With the FOPEN function, you can also specify the file's record length. If you specify a record length of 0, the existing record length is used. For details about the modes and record lengths and how to specify them, see FOPEN.
Making an Open File Available to Other Programs |
Number of Open Files Allowed |
Although SCL allows you to have a large number of files open simultaneously, you should be aware that memory is allocated for each file from the time the file is opened until it is closed. Therefore, you should try close files as soon as your program is finished with them.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.