Creating a Permanent Library
You can create your own library by using a LIBNAME statement.
Example
Libname Newlib '/home/your_user_name';
The LIBNAME statement consists of three parts:
Note: you must change the path to include your unique home directory location. For more details, please visit here.
The LIBNAME statement above creates a library called Newlib:
The Newlib library is directly connected to the home directory on your SAS server.
Saving a Data Set
You can save a current SAS data set by simply copying the data into the permanent library using a SET statement.
Example
** Please change the path in the Libname statement below **;
Libname Newlib '/home/your_user_name';
Data Newlib.Cars;
Set SASHelp.Cars;
Run;
In this example, the data is read from the SASHelp library and written into the Newlib library.
The CARS data set is created in the Newlib library:
✍️ Exam Tips
In order to create a permanent library, you need to submit the LIBNAME statement.
The Work library is the only temporary library in SAS. All other libraries are permanent.
The SET statement is used to copy the data from one data set to another.
When referencing a permanent library, the library reference must be used.
? Sample Exam Question(s):
Question 2
Question 3
Question 4
Question 5
Question 6
Question 2:
The answer is (d).
The LIBNAME statement should be submitted to create a permanent library in SAS.
----
Question 3:
The answer is (b).
The data set created is TEMP.SALES. This is a permanent data set saved in the TEMP library.
Note: the same data set can be referenced in both read and write operations. Data sets can also be merged, even when they are in different libraries. Hence, (c) and (d) are not correct.
----
Question 4:
The answer is (d).
The data is read from SASUSER.HOUSES and written to TEMP.REPORT. Both are permanent SAS data sets.
----
Question 5:
The answer is (d).
The SET statement saves the data set in the permanent SASDATA library.
----
Question 6:
The answer is (b).
The SALES data set created in the data step is stored in the SASDATA library. However, the PRINT procedure references the data set in the Work library, which does not exist.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |