Tuesday, 28 April 2015

Introduction to SAS Language!!

‘SAS’ stands for ‘Statistical Analysis System’.  It is a computer programming language used for statistical analysis. SAS reads data from datasets, database, spreadshits, dat files and after processing or statistical analysis output is generated in the form of graphs, tables, listing, html, rtf, text and in pdf format.  SAS compliers can be run on linux, wimdows, unix and various other mainframe computers.
SAS institute has developed a ‘SAS software’ to run the SAS language.  It provides graphical point-click user friendly interface so that non technical users can swing easily in the software by using advanced options.
                SAS program contains usually two types’ main steps and those are Data Step and Proc Step. In SAS each step is called as ‘Statement’. Statements end with semi-comma ‘;’.
Data Step:  It manipulates and retrieves data and creates data set within two phases  Compilation and  Execution.
Data sets are arranged in tabular format i.e. in rows and column format. Rows are considered as ‘Observations’ and columns are known as ‘Variables’. Observations contain number of each individual row and Variables contain headers and respective data.
Proc Step: ‘Proc’ stands for procedure. It analyses and reports data from the dataset into statistics, analysis and graphical format. Proc steps perform sorting, reporting, sql database and other operations. There are more than 300 proc steps for different operations.
Macros are also used in SAS to perform repetitive tasks and to reduce bulky nature of program.
Example of data step and proc step are given below.

data abc_1;
                set abc;
                <statements>;
                <conditional statements>;
                <statements>;
                      -----------;
run;
proc  <specific proc operation e.g. sort, report etc> data = abc_1 out = abc_2;
<statements>;
run;

No comments:

Post a Comment