SAS Basics – Setting up sample data
Before jumping to SAS tutorial, you should learn SAS basics like determining what SAS solution or environment that we are using, Determining whether we have write access or not and Setting up practice data in SAS studio.
As part of these SAS tutorial, we are running SAS studio. If you are not sure about what you are running navigate to SAS software menu and select Help > About.
Determining Write Access in SAS studio.
SAS studio or SAS University Editions may not have write access to SAS user directory. Write access to Sasuser directory must be enabled using simple code:
proc options option=rsasuser;
run;
To run the following code, go to navigation pane and select New > SAS program. Now enter the code in the program and click on Run all button as shown below.
The result from OPTIONS procedure code is NORSASUSER, the Sasuser folder is writable. If the result from PROC OPTIONS code is RSAUSER, then the Sasuser folder is Read only and we must redirect the Sasuser using simple statement.
Redirecting the SAS user folder.
To redirect Sasuser folder, use LIBNAME statement. Follow the steps given below :
- We must create new folder in the folder pane. To create, navigate to folder pane > select My folders > Right click on the folder > Select New > Folder as shown below.
- Enter name for a folder as tutorialkart.com.
Now redirect the SASUSER library folder to tutorialkart.com folder using LIBNAME statement (for SAS University Edition).
libname sasuser "/folders/myfolders/tutorialkart.com";
- Finally save the program as libname_tutorialkart.com.
Importing Sample data into SAS environment.
To set up practice data in SAS Studio or SAS University Edition:
- Copy the sample data program into a new Code window.
- You can access the sample data at http://support.sas.com/publishing/cert/sampdata.txt.
- Click Run