Using External Files |
In addition to using SCL to manipulate SAS tables, you can use it to manipulate external files. External files are files that are created and maintained on a host operating system (for example, files that you have created with your system editor or files in which you have stored the output of SAS procedures). They have different internal formats than SAS files.
When you use external files to store data or other information, you can use SCL functions to read, update, and write information to new files, and to perform utility operations on existing files. These functions enable you to create SCL programs that do the following:
manipulate data values that your site maintains in external files
write information in a form that can be read by applications that were created with the software of other vendors.
Note: Your operating system maintains groups of files in an aggregate storage location. Your operating system may identify these locations with different names (for example, directory, folder, subdirectory, partitioned data set, or MACLIB). If you need more information, see the SAS documentation for your operating environment.
Ordinarily, you must use a logical name called a fileref to identify the location of an external file to SAS software. SCL allows you to assign a fileref to a directory and then to open and perform operations on as many of its files as the program requires.
Many functions that perform external file operations return a SAS system return code, called sysrc. SAS System Return Codes contains a list of return codes with a section for operations that are commonly performed on external files. You can check for these codes to write more sophisticated error checking for your SCL programs.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.