abhishekdagarit
9/20/2017 - 11:50 AM

SAS rules

SAS rules

SAS rules

Case sensitive

SAS in not case sensitive.

proC PrinT daTa = woRK.IntrO;
WHerE Rating = 2;
run;

SAS is case sensitive while comparing.

proc print data = work.InTro;
where rating = 2;
run;

Spaces don't matter

proc print data = work.intro; where rating =2; run     ;

Variables in SAS

proc print data = work.intro;
where rating = 2;
run;

\\rating is a variable here

Work library

Work is the default library.

data test5;
input x y p q;
datalines;
1 2 55
3 4 77
5 6 99
7 8 33
9    10 44
;
run;

proc print data = test5;
run;

Data step

data work.test;
x=12;
y=34;
z= 35;
run;

Proc step

proc print data = work.test;
run;

Data types in SAS

There are only two datatypes in SAS. char and numbers.

Characters end with a dollar sign.

data work.test9;
input name$ age salary;
datalines;
a 23 442323
b 43 23423423
c 32 4242443
d 44 3242424
;
run;

proc print data = work.test9;
run;

Can't perform numeric operations on characters.

Comma is usually not required

Comments in SAS

There are two ways to mention comments in SAS

* class post;
* semicolon is needed;
/*  class post; */