The following SAS program is submitted:
data work.test;
type='SQL';
if type='SAS' then description='SAS Program';
else description='other'; length description 8;
run;
What occurs when the program is submitted?
Select one:
Answer : D
SIMULATION
Scenario:
Open the existing program, program48.sasfrom folder cert\errors. At any time, you may save your corrected program asprogram48incert\programs. This program is intended to:
O Create 3 groups for C var: A-G is Group=1; H-N is Group=2; O-Z is Group=3.
O All variations of the variable should be in the same group, i.e. "A" and "a" should be in Group=1.
O Calculate the average of X and Y by Group. There are multiple errors in the program. These may be syntax errors, logic errors, or problems with the program structure. Logic errors might not produce messages in the log, but will cause the program to produce results different than intended. Correct the errors, run the program, and then use the results to answer the next 2 questions. What is the average (mean) of X for Group=2? Enter your answer to the nearest whole number. Enter your numeric answer in the space below:
Answer : A
SIMULATION
Scenario:
Open the existing program, program44.sasfrom folder cert\errors. At any time, you may save your corrected program asprogram44incert\programs. This program is intended to:
O Create a new data set using thecert.input44set as input
O Drop variables:bp_status, weight_status, andsmoking _status.
o Create a new column,chol_status, based on the following values of cholesterol:
less than 200: "Safe"
200-239: "High - Borderline"
240 and higher: "High" oShould not calculatechol_statusfor missing cholesterol values There are multiple errors in the program. These may be syntax errors, logic errors, or problems with the program structure. Logic errors might not produce messages in the log, but will cause the program to produce results different than intended. Correct the errors, run the program, and then use the results to answer the next 3 questions. How many variables are in thework. outdata set? Enter your numeric answer in the space below:
Answer : A
SIMULATION
Scenario:
This project will use data setcert.input04. At any time, you may save your program asprogram04incert\programs. Write a SAS program that will create the data setresults.output04.
In this program, complete the following mathematical actions, in the following order:
Round VAR1 and VAR2 to the nearest integer values.
Multiply the rounded VAR1b y the rounded VAR2 and assign the new value to VAR3.
Add VAR12 through VAR19 (8 variables) together, ignoring missing values. Assign the sum to VAR20.
For observation 16, what is the value ofVAR20? Enter your numeric answer in the space below. Round your answer to the nearest whole number. Save your program asprogram04.sasincert\programs before continuing with the next project
Answer : A
SAS code that could be used to solve this project:
data results.output04;
set cert.input04;
var3=round(var1,1)*round(var2,1);
var20=sum(of var12-var19);
run;
proc print data=results.output04 (obs=16 firstobs=16);
var var3 var20;
run;
If you got this question wrong because you didn't round to the nearest whole number, please know that the actual exam will restrict you to entering only a whole number to prevent this from occurring. The correct answer is: 3175
SIMULATION
Scenario:
This project will use data setcert.input36. At any time, you may save your program asprogram36 in cert\programs. Write a SAS program that will clean the data incert.input36as follows:
Step 1:
create a temporary data set, cleandata36.
In this data set, convert all case.
Then keep only observations with group equal to 'A' or 'B'.
Step 2:
Determine the MEDIAN value for the Kilograms variable for each group(A,B) in the cleandata36
data set. Round MEDIAN to the nearest whole number.
Step 3:
Create results.output36 from cleandata36
Ensure that all values for variable Kilogramsare between 40 and 200, inclusively.
If the value is missing or out of range, replace the value with the MEDIAN Kilograms value for the respectivegroup(A,B) calculated in step 2
What is the MEAN Kilograms value for group='A' in the results.output36 data set?
Answer : A
A PROC PRINT report was created with the following title:
Asia Sports Vehicle Summary After the PROC PRINT report is run, a programmer would next like to produce a PROC FREQ report with the following title: Asia Sports Vehicle Summary Distribution by Make Which statement(s) would produce the new report titles?
Select one:
Answer : C
SIMULATION
Scenario:
This project will use data set cert.input08a and cert.input08b. At
any time, you may save your program
as program08 in cert\programs.
Both data sets contain a common numeric variable named ID.
Write a program that will use a SAS DATA Step to:
o Combine data sets cert.input08a and cert.input08b by
matching values of the ID variable.
o Write only observations that are in both data sets to a
new data set named results.match08.
o Write all other non-matching observations from either
data set to a new data set named results.nomatch08.
o Exclude all variables that begin with
"ex" from results.nomatch08.
How many variables (columns) are in results.match08
Answer : A
proc sort data=cert.input08b out=work.input08b;
by ID;
run:
data results.match08 results.nomatch08 (drop=ex: );
merge work.input08a (in=a) work.input08b (in=b);
by ID;
if a and b then output results.match08;
else output results.nomatch08;
run;
proc contents data=results.match08;
SAS code that could be used to solve this project:
proc
sort data=cert.input08a out=work.input08a;
by ID;
run:
run;
proc contents data=results.nomatch08;
run;
The correct answer is: 117