When a library is not specified, SAS automatically uses the temporary library "work." Note that once it has been linked to the extern SAS library, it does not need the extension. The data set copy_cd4count.sas7bdat which is stored in the directory "C:\temp", is now in the extern SAS library and can be used immediately in SAS data steps and procedures. The libname statement below creates a SAS library named extern and links the library extern to the directory "C:\temp" on the computer. Import the permanent SAS data set, copy_cd4count, into SAS. The next statement calls from the library called "perm" and selects the data set called "dixonmassey." The statement below creates a SAS library named "perm" and then links "perm" to the F drive. The statement data perm.dixonmassey creates a SAS data set called "dixonmassey.sas7bdat" located in the F drive. Then save the data set dixonmassey as a permanent SAS data set on the F drive.
Use a libname statement to establish the library perm and to link it to the F drive. Note: The 'dixonmassey' data set is from Dixon WJ and Massey FJ Jr: Introduction to Statistical Analysis, Fourth Edition, McGraw Hill Book Company, 1983. In the directory linked to the library lib, there will be a (permanent) data set called ds.sas7bdat. imported from the computer directory for use in SAS.Ī SAS data set name has the library name before the period and the data set name after the period.įor example, lib.ds indicates that data set ds is in library lib.
Once a SAS library and computer directory link have been created using the libname statement, a permanent SAS data set can be: