By Ajeet Kumar
SAS
PROGRAMS FOR ABSOLUTE BEGINNERS BY AJEET KUMAR
/* Dataset Option
Program Number: 1 */
data Write (write
= sales);
infile student;
input Name : $10.
Age;
run;
proc print ;
run;
/* Dataset Option
Program Number: 2 */
data
class0(Drop=Sex);
set sashelp.class;
run;
/* Dataset Option
Program Number: 3 */
data class1(Keep
= Name Sex );
set
sashelp.class;
run;
/* Dataset Option
Program Number: 4 */
data
class2(rename=(Sex=Gender));
set
sashelp.class;
run;
/* Dataset Option
Program Number: 5 */
libname good
"C:\Documents and Settings\Ra\My Documents\Datasets";
data good.person
(replace=no);
set
sashelp.class;
run;
/* Dataset Option
Program Number: 6 */
data
class3(Label="Dataset class4 is about Students Personal Info");
set
sashelp.class;
run;
/* Dataset Option
Program Number: 7 */
data datapass
(pw="ajeet" pwreq=yes);
set
sashelp.class;
run;
/* Dataset Option
Program Number: 8 */
data datapass
(pw="ajeet" pwreq=yes);
set
sashelp.class;
run;
/* Dataset Option
Program Number: 9 */
data where(where=(gender
is missing)) keep(keep=age height) drop(drop=weight);
set libref.class;
run;
/* Dataset Option
Program Number: 10 */
proc print
data=class(firstobs=2 obs=12) N="Total Records: ";
run;
proc print
data=class(firstobs=2 obs=12 drop=remarks Height) N="Total Records:
";
run;
proc print
data=class(rename=(name=S_name)) N="Total Records: ";
run;
/* Dataset Option
Program Number: 11 */
data
Password(pw=sales);
infile student;
input Name : $10.
Age;
run;
proc print ;
run;
/* Dataset Option
Program Number: 12 */
data Alter (alter
= sales);
infile student;
input Name : $10.
Age;
run;
proc print ;
run;