Accessing your own data sets IINow that you have the data sets in the shared folder, you can access them by creating a library that connects to the shared folders.
This can be done by using a LIBNAME statement.
Example
LIBNAME Proj1 "/folders/myfolders";
The LIBNAME statement consists of 3 parts:
1. LIBNAME
This tells SAS to create a new library.
2. Library Name
The second part of the LIBNAME statement is the library name. In our example, it is PROJ1.
3. Directory Path
Lastly, you will have to associate the library with a shared folder.
In our example, the directory path to the shared folder is:
/folders/myfolders
**** Important note ****
The directory path
/folders/myfolders
is associated with the shared folder that you have created:
/SASUniversityEdition/myfolders
Any data set from myfolders can now be accessed in SAS Studio through the PROJ1 library.
Now, run the LIBNAME statement above:
LIBNAME PROJ1 "/folders/myfolders";
A new library called PROJ1 is created:
PROJ1 is directly connected to the myfolders, which is the shared folder that contains the car data set.
Now, you can access the car data set from PROJ1.
Exercise
In our last exercise, we have saved the INCOME data set in the DS1 shared folder.
Write a SAS program to copy the INCOME data set into the WORK library.
Need some help?
HINT:
In order to access the INCOME data set, you must create a library associated with the shared folder that contains the INCOME data set.
SOLUTION:
Libname PROJ2 '/folders/myfolders/DS1';
Data Income;
Set PROJ2.Income;
Run;
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. |