Temporary and permanent data sets
Temporary data sets
When you create a data set using the data statement
data first;
the data set is saved in SAS' temporary files. When the session is ended it is deleted and needs to be read again to be used in a new session. The library for the temporary data sets is called WORK and can be found in the Explorer on the left hand side of SAS. Double´-click on libraries and WORK and you will find your data sets here.
Permanent data sets
If you want to save the SAS data set permanently you an use either the SAS library SASUSER or any of your catalogues on your computer. Here we use the data set 'first' created on the page on the SAS structure.
Save to the SASUSER library:
data sasuser.first;
set first;
run;
Read the data next time as:
data first;
set sasuser.first;
run;
Save to your own library:
Specify your own library/catalogue using the libname statement. Here is an example if you have a catalogue that is called SAS and lies under projects. SASfiles is the name we will use in the programs.
libname SASfiles 'z:/projects/SAS/';
Save the file:
data SASfiles.first;
set first;
run;
and read it next time:
data first;
set SASfiles.first;
run;