By Ajeet Kumar
SAS
PROGRAMS FOR ABSOLUTE BEGINNERS BY AJEET KUMAR
* Proc Print Program
Number: 1 ;
proc print data =
class1 label heading=v;
var Gender -- Doj
;
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
of Joining';
run;
* Proc Print Program
Number: 2 ;
proc print data =
class;
run;
* Proc Print Program
Number: 3 ;
proc print data =
class;
var Name Age
Height;
run;
* Proc Print Program
Number: 4 ;
proc print data =
class;
var Name Height Age;
run;
* Proc Print Program
Number: 5 ;
proc print data =
class;
var _numeric_;
run;
* Proc Print Program
Number: 6 ;
proc print data =
class;
var Weight Height
;
run;
* Proc Print Program
Number: 7 ;
proc format;
value
$Genderx 'M' = 'Male' 'F' = 'Female';
value
$statex 'UK' = 'Uttarakhand'
'RS' = 'Rajsthan'
'MP' = 'MadhyaPradesh';
run;
proc print data =
class;
var Gender -- Doj
;
format Gender
$Genderx. State $Statex. ;
run;
* Proc Print Program
Number: 8 ;
proc print data =
class;
var Gender -- Doj
;
where Income <
15000 ;
format Gender
$Genderx. State $Statex. ;
run;
* Proc Print Program
Number: 9 ;
proc print data =
class;
var Gender -- Doj
;
where Income <
15000 ;
id Name;
format Gender
$Genderx. State $Statex. ;
run;
* Proc Print Program
Number: 10 ;
proc print data =
class label;
var Gender -- Doj
;
title 'Learining
About IN Operator';
footnote;
where state in (
'MP', 'RS');
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
of Joining';
run;
* Proc Print Program
Number: 11 ;
proc print data =
class label;
var Gender -- Doj
;
sum _numeric_;
title;
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
of Joining';
run;
* Proc Print Program
Number: 12 ;
proc print data =
class label;
var gender --
income ;
sum _numeric_;
title;
format gender
$genderx. state $statex. income dollar9.1;
label doj = 'date
of joining';
run;
* Proc Print Program
Number: 13 ;
proc sort data =
class out=class1;
by state;
run;
proc print data =
class1 label;
var Gender -- Doj
;
by State;
sum _numeric_;
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
of Joining';
run;
* Proc Print Program
Number: 14 ;
proc print data =
class1 label;
var Gender -- Doj
;
by State;
sumby State;
sum age --
income;
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
of Joining';
run;
* Proc Print Program
Number: 15 ;
proc print data =
class1 label;
var gender -- doj
;
by state;
pageby state;
sum age --
income;
format gender
$genderx. state $statex. income dollar9.1;
label doj = 'date
of joining';
run;
* Proc Print Program
Number: 16 ;
proc print data =
class1 label n = "Total Number of Records: ";
var Gender -- Doj
;
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
of Joining';
run;
* Proc Print Program
Number: 17 ;
proc print data =
class1 label double split='\' width=uniform;
var Gender -- Doj
;
format Gender
$Genderx. State $Statex. Income dollar9.1;
label Doj = 'Date
\of Joining';
run;
No comments:
Post a Comment