Using External Files |
When an SCL program starts executing, an SCL Data Vector (SDV) is created for the program. The SDV contains temporary storage areas for the program's SCL variables. Values of program variables are manipulated and stored in the SDV before they are written to or deleted from an external file. When an external file is opened, a temporary storage buffer called the file data buffer (FDB) is created for it. The FDB is the length of the file's records, and it is empty until a record is read from the file. A "read" function copies a record from the file into the FDB. A "write" function moves the contents of the FDB to a record in the physical file and clears the file's FDB. Once a record is in the FDB, it remains there until the record is written back to the file, until another record is read in, or until the file is closed.
Path of Data in File Read and Write Operations illustrates the SDV and the FDB for an application that uses an external file. This figure shows the paths that file records take when they are read from the file, displayed in the window, processed, and then returned to the file.
Path of Data in File Read and Write Operations
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.