|
Creating Permanent SAS Files
Specifying the data in this way can be tedious, and not just for you, the user. While you're waiting for SAS to go through what could be very long input statements (imagine the input statement from the cumulative version of the NES, for example, which boasts hundreds of variables), the computer is grinding away, using lots of memory and swap space to write the data set that you've specified. Once SAS is done, it deletes these file; hence, they're often called temporary or work data files.
Often, you'll find that you need to run many different programs on the same data over the course of a single reserach program, but that the recodes and other computations will be the same or virtually the same for all the programs you need to run.
With each data step you perform, SAS creates a temporary work data file; at the end of your job, this file is deleted. Often it's easier to create a permanent data set, or SAS system file. This is a file that stays on the computer after the job ends and that contains both your data, all the information SAS needs to read them, and any additional calculations you had performed and saved in the dataset. Moreover, since SAS doesn't have to run through all those data steps, using permanent data sets is more efficient in terms of your time, SAS's time, and your computer's resources.
If you want to create a SAS system file, you must first tell SAS where it should save the data. You do this by specifying a library name with the LIBNAME statement:
Your data statement will now take the following form:
Reading SAS System Files
You may use permanent data sets in your programs in any place where you would usually define a temporary dataset. Remember, though, that you must always have told SAS which data library you're referring to with a LIBNAME statement somewhere within (usually at the beginning) your program. You may wish to perform additional calculations on the data, in which case you would specify the file within a DATA step:
|