Академический Документы
Профессиональный Документы
Культура Документы
Class/Section: 7 IT2 Y
Data student;
Input Rollno,name$;
Datalines
23 parul
24 payal
25 priya
Output:
Program No:2
Data one;
Input x y;
Datalines;
Data two;
input x y;
Datalines;
45
67
Data three;
Option Nocentre;
data demo;
Output:
Program No:4
Data financial;
Title"Demonstrating Columns"
Output:
Program No:5
data quizlange;
datalines;
21 M 80 B 92
F 80 B+ 93
22 F 90 B 94
23 M 91 C- 95
25 F 92 C+ 96
run;
Title "Quiz-Range";
OUTPUT:
Program No:6
data table;
do n=1 to 10;
square=n+n;
squareroot=sqrt(n);
output;
end;
run;
run;
OUTPUT:
Program No:7
data conditional;
select(agegroup);
when(1) limit=110;
when(2) limit=120;
when(3) limit=130;
otherwise;
end;
datalines;
21 M 80 B 92
24 F 80 B+ 93
22 F 90 B 94
23 M 91 C- 95
25 F 92 C+ 96
WAP to demonstrate the Use of sum statements & iterative Do loop operator in SAS.
data compound;
interest =0.315;
total=100;
do year=1 to 3;
total= total+interest;
output;
end;
run;
OUTPUT:
Program No:9
Data females;
if gender eq 'F';
Datalines;
21 M 30 B 82
20 F 90 A 93
22 F 89 B 94
23 M 92 A 95
OUTPUT:
Program No:10
Data conditional;
Datalines;
21 M 30 B 82
20 F 90 A 93
22 F 89 B 94
23 M 92 A 95
OUTPUT:
Program No:11
data grades;
agegrp='younger gr';
grade=0.4*midterm+0.6*final_exam;
end;
agegrp='older grp';
grade=(midterm+final_exam)/2;
end;
run;
run;
Output:
Program No:12
data double;
interest=0.0375;
total=100;
do whiel(total le 200);
year+1;
total=total+interest*total;
output;
end;
run;
run;
OUTPUT:
Program No:13
data double;
interest=0.0375;
total=100;
do until(total ge 200);
year+1;
total=total+interest*total;
output;
end;
run;
run;
OUTPUT:
Program 14:
Leave Statement:
data leave_it;
interest=0.0375;
total=100;
do year=1 to 100;
total=total+interest*total;
output;
end;
run;
title"leave statement";
run;
OUTPUT:
Continue Statement:
data continue_on;
interest=0.0375;
total=100;
do year=1 to 100;
total=total+interest*total;
end;
title"continue statement";
run;
OUTPUT: