Introduction to SAS 

We Would be covering the Below topic in this Blog :

  1. Introduction to SAS

  2. Registering on SAS Studio Online

  3. Understanding SAS Studio Interface

  4. Libraries in SAS Overview

  5. SAS Data Types ,  Statements, Proc Overview

 

1.Introduction to SAS

SAS stands for "Statistical Analysis System" is a software pursuit developed by SAS Institute for advanced analytics. SAS was developed at North Carolina State University from 1966 to 1976 . It is developed by James Goodnight and Anthony Barr to analyze agricultural data to improve crop yields . The project is funded by the National Institute of health .

SAS components include :

  • Base SAS - Basic procedures and data management

  • SAS/STAT - Statistical analysis

  • SAS/GRAPH - Graphics and presentation

  • Enterprise Miner - Data mining

  • SAS Grid Manager - Manager of SAS grid computing environment

 

2.Registering on SAS Studio Online

 

To work in SAS online , you have to create an account in SAS  - SAS Studio .  For New users , you need to click on "Register For an account" , Enter your details ,


 

You will get the below message and you would need to accept the SAS OnDemand Academic licence.

 

After around 15 mins you will receive an email with activation link to your SAS profile on the email id provided.  Enter your email id / pwd and confirm password to create your account.

After this you get the below screen






 

3.Understanding SAS Studio Interface

Once you receive confirmation , You can SIGN IN this account to access SAS Studio for Academic use . You can access SAS anytime by using SAS Studio online by this link - SAS Studio

Once you login you will see the below screen . Click on “SAS Studio” ( Highlighted in Red ) to open your SAS Studio

The SAS Studio can be viewed as -

You can see Server Files and Folders in the left side of the window .

We are using Files and Libraries mainly to explore data.

1. Files(Home) - To create a SAS program file and store it

2.  Libraries - It is used to show all the libraries associated with SAS.

We open a new Program file in two different ways:

1. First click on Files(Home) , then right click on New tab and click on SAS Program(F4) .

2. By simply press function key F4 .

You can see there are three windows CODE , LOG and RESULTS in our Program 1 file .

 

  1. CODE Window :  We can write all the codes in this window .

  2. LOG Window : This window shows Errors , Warnings and Notes related to program .A log window checks the execution of SAS program .

                         

  1. RESULTS Window : It shows the output of our program.

 

4.Libraries in SAS Overview

Libraries in SAS

Libraries store predefined user libraries. It contains following libraries :

 

When we open MAPS library , it shows following sub-folders .

These sub-folders represent datasets associated with MAPS library .

Library is a collection of datasets.

Dataset

It is a combination of rows and columns . We have a dataset of four rows and two columns . We can call  variable names as Name , Score . We can call rows as observations in our dataset.

It shows Name and Score of four persons.

We have two types of libraries :

  • Temporary or Work Library

  • Permanent Library

Temporary or Work Library

This is the default library of SAS . When we create a program in SAS , it stores in Work library . If you create a SAS program and have not assign any permanent library to it .It will store in Work library or called as temporary library. When you close the session  and open again ,it will not show any dataset in work library .This library did not store datasets after close the session.

Permanent Library

This library can store the dataset permanently. If we create a program and save it in this library then it will available lifelong.

5.SAS Data Types , Variable Names,  Statements, Proc Overview

  1. SAS Data types

SAS has only two types of data or variables :

  • Character

  • Numeric

Character data type

It includes all alphabetic characters , numbers , special symbols etc.

Numeric data type

It includes only numbers 0-9 .

2. Variable Names

The variable or dataset name follow below rules :

  • It can be maximum 32 characters long.

  • It cannot include blanks between variable names like emp id , x 1 etc.

  • It must start with letters A through Z or an underscore(_) . Example abc , Ask, _asd etc.

  • It can include numbers but not as first character.

  • Variable names are case insensitive.

  • It does not use hyphen(-) . Example emp-id , a-1 etc.

  • Special characters are not allowed like $ , % etc.



 

3. Comments

It is a readable explanation or annotation in program helps us to understand the program code.

*message; type comment

A comment in the form of *message; cannot contain semicolons or unmatched quotation mark inside it.

It can span multiple lines . These are examples of comments :

*This is a comment;

*This is multiline comment.

This is the second line;

/*message*/ type comment

This type of comment is used more frequently and it cannot be nested . It can be span multiple lines.

/*This is comment*/

/*This is the first line.

This is the second line*/

 

4. SAS Statements

  • Statements can start anywhere and end anywhere . A semicolon(;) is used to end the statement.

  • We can write one statement in number of lines.

  • We can write many statements in one line .

  • Space can be used to separate the components in a SAS program statement.

  • SAS keywords are not case sensitive.

  • Every SAS program ends with a Run statement.

 

5. SAS Data Set

The Data statement marks the creation of a new SAS data set . The rules for data set creation are :

  • We create a new data set by using Data keyword and write the name of data set .

  • To store data set permanently , we can prefixed with a library name in the data set name.

  • If the SAS data set name is omitted then SAS creates a temporary data set with a name generated by SAS like - DATA1 , DATA2 etc.

Examples -

*Temporary Data set;

Data abc;

Data new;

*Permanent Data set;

Data mylib.new;  *mylib is permanent library and new is dataset ;

Data library1.data1 ;  *library1 is permanent library and data1 is dataset name;

We have two types of steps :

1. DATA Step

2. PROC Step

DATA Step

This step helps to create a dataset and store into SAS .

The syntax of DATA Step is :

Data data_set_name ;                    * Name of the data set;

Input var1 var2 ;                              * define variable in this data set;

New_var;                                          * create a new variable;

Label;                                                * Assign labels to variables;

Datalines;                                         * Enter the data ;

run;                                                    * Execute data step;

PROC Step

The step is used to apply built-in procedure to analyze the data .

The syntax is :

PROC procedure_name options;  *The procedure_name is the name of procedure;

RUN;

Example - PROC MEANS; RUN;  

 

Comments

There are no entries yet.
Please enter the code
* Required fields

Subscribe to our mailing list

* indicates required

Looking for Corporate Training ? Reach out to us at Akriti.Lal@instrovate.com

Reach out to us if you are looking for Corporate Training to Build The Next Generation Analytical Workforce with an in-depth understanding of  Exploratory Data Analysis , Data Visualisation, Data Analytics , AI First , Machine Learning & Deep Learning Training & Consulting helping them to take Data Informed Decision at each stage of the business. 

We understand that At the present times , the Entire Industry is in a Tranformation stage with the Softwares  being rebuilt with Artificial Intelligence Capabilities .

We need SMART WORKFORCE for the SMART SOFTWARES to reap the maximum return . 

 

Whatsapp at +91-9953805788 or email at - akriti.lal@instrovate.com if you would like to know more . 

 

  • Corporate Tableau Training in Gurgaon
  • Corporate Data Analytics Training in Gurgaon
  • Corporate Microsoft Power BI Training in Gurgaon
  • Corporate Microstrategy Training in Gurgaon
  • Corporate Google Data Studio Training in Gurgaon
  • Corporate Python Training in Gurgaon
  • Corporate Advance Analytics in R Programming Training in Gurgaon
  • Corporate Machine Learning Training in Gurgaon
  • Corporate Deep Learning Training in Gurgaon
  • Corporate Data Visualization Training in Gurgaon

 

Address

Instrovate Technologies

Noida, Gurgaon

 

akriti.lal@instrovate.com 

Hit Your Refresh Button To Rise Higher
Print Print | Sitemap
All rights reserved @ Instrovate Technologies
GSTIN : 09AAECI6862K1Z1

Terms Of Services    Privacy Policy    Disclaimer     Refund Policy    


Call

E-mail