Which of the statements finishes the code correctly?
data long_address;
set student;
....
run;
C) where lengthn(address)>50;
T/F: In SAS, a variable can be both character and numeric
False
Which of the statements finishes the code correctly?
data student_data;
set student;
....
run;
A) add_upcase=upcase(address);
T/F: The STRIP function removes leading and trailing blanks
True
If variables course_subject="BAS" and variable course_num="150" what code correctly creates output of:
"BAS-150"
B) catx('-', course_subject, course_num);
If the variable phone contains:
phone=(919)677-8008
What is the output of the code substr(phone,6,4);
C) 677-
In the code below, the input function takes a character variable and creates a numeric variable.
grades=input(old_grades,8.);
True
The code below creates what type of chart?
title "Weight v Height";
proc sgplot data=sashelp.class;
scatter x=height y=weight;
yaxis label="Weight in pounds";
xaxis label="Height in inches";
run;
D) Scatter Plot
The code below creates what type of chart?
title "Hospital B - August 5th";
proc sgplot data= Blood;
vbar BloodType;
xaxis label="Blood Type";
yaxis label="Patient Counts";
run;
B) Vertical Bar Chart
Examine the bar chart below. How many observations from the data set are represented in this chart?
A) 8
What does the LENGTHN function do in the following code?
data Long_Names;
set Sales;
where lengthn(Name)>12;
run;
creates a data set that includes all names that are longer than 12 characters
What does the LOWCASE function do?
converts all letters to lowercase
What does the UPCASE function do?
Converts all letters to uppercase
What does the PROPCASE function do?
Capitalizes the first letter of every "word" and converts the remaining letters to lowercase
What function is used to remove leading and trailing blanks?
STRIP
Putting strings together is called concatenation, and which SAS function is most used for this function?
CATX
Which is equivalent to the following code?
Name= strip(First) || " " || strip(Last_Spaces);
C) Name= catx(' ', First, Last_Spaces)
How does the SUBSTR (substring) function work?
specify the string you are searching, the starting position, and the length of the substring
variable, position start, # of characters
T/F: A variable can be both character and numeric
False
What is the INPUT function used for?
changing a character to numeric variable by making a new variable from the old one
grades=input(old_grades, 8.);
How do you create a vertical barchart with proc sgplot?