Skip to content

Instantly share code, notes, and snippets.

abhishek abhishekdagarit

Block or report user

Report or block abhishekdagarit

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lists in

Creating a list

A list is like a super data type that can hold any other data type inside it.

# Vector with numerics from 12 up to 100
my_vector <- 12:100 

# Matrix with numerics from 1 up to 8
my_matrix <- matrix(1:8, ncol = 2)
View Merging datasets in

Merging datasets in SAS

The process is straight forward.

Data 1

data d1;
input name$ age;
abhishekdagarit / SQL select
Last active Sep 27, 2017
Basic SQL commands to be used in SAS as well as any other place.
View SQL select

SQL select statement


Simplest Select satament

proc sql;
select * 
View Global statements in

Global statements in SAS

List of global statements in SAS

  1. title
  2. options
  3. footnote

Properties of global statements in SAS

View Frequency in

Frequency in SAS

Used using the proc freq statement

complete frequency table

proc freq data=work.test;
View Special

Special cases

Maximum number of decimal places

proc print data=work.temp maxdec=2;

labels in SAS

View Calculating mean in

Calculating mean in SAS

To calculate mean simply use proc means

proc means data = work.test;
var ratings;
View Sum of

Sum of single variable

Simply write sum followed by the variable name.

proc print data=test;
sum salary;
View Sort function in

Sort function in SAS


Basic sort function. Uses by.

proc sort data=work.test;
by Salary;
View SAS

SAS rules

Case sensitive

SAS in not case sensitive.

proC PrinT daTa = woRK.IntrO;
WHerE Rating = 2;
You can’t perform that action at this time.