0% found this document useful (0 votes)
13 views

Activity3 A213 PA

The document contains questions and answers about SAS programming. It also contains tasks to work with the CLASS dataset from SASHELP library, including sorting the data, printing it with subtotals and split options, and adding titles, footnotes, and labels.

Uploaded by

Vishwas Dhabhai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Activity3 A213 PA

The document contains questions and answers about SAS programming. It also contains tasks to work with the CLASS dataset from SASHELP library, including sorting the data, printing it with subtotals and split options, and adding titles, footnotes, and labels.

Uploaded by

Vishwas Dhabhai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

ACTIVITY – 3

Vishwas Dhabhai B.Tech – IT A213

Q1] Can arithmetic operators be used with the character variables?


- No.

Q2] What is the option for going to a specific line number of a code?
- Enter line number and the cursor will take you to the line.
-

Q3] What is the option to quickly format a code that is currently open in SAS Code
window?

Q4] Paste the icon for an option available in SAS Studio interface to quickly clear the
contents of a SAS Code.
Q5] Will the following code display all the observations having age and height greater
than OR equal to 72? Explain.

footnote "Activity submitted on %sysfunc(today(), date9.)at


%sysfunc(time(),timeampm.)";
proc print data = SASHELP.CLASS noobs;
var Name Sex Age Height Weight;
sum weight;
where height and age>=72;
title ‘MBA Students’;
run;

- Output comes as no observations because the condition is not applicable for age
and it is only applicable for height.

Q6] Does ‘Format Code’ option available in toolbar adjusts the spacing between
adjacent words?

- No

Q7] “Name of the SAS dataset input is displayed in the ‘Results’ tab”. What is the
fallacy in this statement?

- Name of the class is not displayed.

Q8] What is the fallacy in the output of the following code? How to correct it?
footnote "Activity submitted on %sysfunc(today(), date9.)at
%sysfunc(time(),timeampm.)";
proc print data = sashelp.class noobs;
id name;
var Name Sex Age Height Weight;
sum weight;
where age between 11 and 13;
title ‘MBA Students’;
run;
- The ‘Name’ column repeats twice in the output. We can remove ‘Name’ from the
var statement.

Task 1: Use ‘CLASS’ dataset (from Libraries –> My Libraries -> SASHELP) for input
and create an output dataset sorted by name in ascending order and age in descending
order.

proc sort data= SASHELP.class


out= WORK.class2;
by descending age;
by name;
run;
TASK 2: Use ‘CLASS’ dataset (from Libraries –> My Libraries -> SASHELP) for
input and create an output dataset sorted by AGE in ascending. Print it with the BY
variable age to show subtotals of height.
proc sort data= SASHELP.class
out= WORK.class1;
by age;
run;

proc print data=WORK.class1;


by age;
sum height;
run;
Task 3: Use ‘CLASS’ dataset (from Libraries –> My Libraries -> SASHELP) for input
and print it with titles, footnote and labels.
proc print data=SASHELP.class LABEL;
TITLE "Student Table";
footnote "A217";
LABEL NAME="Student Name";
run;

Task 3: Use ‘CLASS’ dataset (from Libraries –> My Libraries -> SASHELP) for input
and print it with split option.
proc print data=SASHELP.class split='*';
var Name Age Height Weight;
LABEL Name="Na * me";
run;

You might also like