sas a00-231 practice test

Exam Title: SAS 9.4 Base Programming - Performance-Based Exam

Last update: Nov 27 ,2025
Question 1

SIMULATION
Scenario:
This project will use data set cert.input27. At any time, you may
save your program as program27 in cert\programs. You will use
this program in the next project.
Write a SAS program that will:
o Create output data set results.output27a as a subset
of cert.input27 where the country variable's value is
"US" (any variation of case, such as US or us).
o Sort results.output27a:
" first by the variable state in ascending order
" then by Postal_Code in descending order
" and finally by employee_ID in ascending order.
Run the program and use the results to answer the question below.
What is the value of Employee_ID for observation 100 in results.output27a?

Answer:

120781


Explanation:
proc sort data=cert.input27
out=results.output27a(where=(upcase (country)='US'));
by state descending Postal_Code employee_ID;
run;
proc print data=results.output27a (firstobs=100 obs=100);
var employee_ID;
run:

vote your answer:
Comments
Question 2

SIMULATION
Scenario:
Continuing with the previous program (program27), add a PROC SORT step that satisfies the
following criteria:
o Creates the output dataset results.output27b
o Sorts the observations by order.
o Removes duplicate values of the first occurrence found during the sort.
What is the value of Employee_ID for observation 98 inresults.output27b?

Answer:

120779


Explanation:
proc sort data=cert.input27 out=results.output27b nodupkey;
by descending postal_code;
run;
proc print data=results.output27b (firstobs=98 obs=181);
var employee_ID;
run:

vote your answer:
Comments
Question 3

SIMULATION
Scenario:
Continuing with the previous program (program27), add a PROC SORT step that satisfies the
following criteria:
o Creates the output dataset results.output27b
o Sorts the observations by order.
o Removes duplicate values of the first occurrence found during the sort.
What is the value of Employee_ID for observation 181 inresults.output27b?

Answer:

120272


Explanation:
proc sort data=cert.input27 out=results.output27b nodupkey;
by descending postal_code;
run;
proc print data=results.output27b (firstobs=98 obs=181);
var employee_ID;
run:

vote your answer:
Comments
Question 4

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
How many observations are inresults.output36?

Answer:

4992


Explanation:
data work.cleandata36;
set cert.input36;
group=upcase(group);
if group in ('A','B');
run;
proc means data=work.cleandata36 median;
class group;
var kilograms;
run;
data results.output36;
set cleandata36;
if Kilograms < 40 or Kilograms > 200 then do;
if group='A' then kilograms=79; else kilograms=89;
end;
run;
proc contents data=results.output36;
run;

vote your answer:
Comments
Question 5

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:

76.3


Explanation:

vote your answer:
Comments
Question 6

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

Answer:

86.5


Explanation:

vote your answer:
Comments
Question 7

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:

5


Explanation:

vote your answer:
Comments
Question 8

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:

47


Explanation:

vote your answer:
Comments
Question 9

Which statement about SAS libraries is true? Select one:

  • A. You refer to a SAS library by a logical name called a lib name.
  • B. A SAS library is a collection of one or more SAS files that are referenced and stored as a unit.
  • C. A single SAS library must contain files that are stored in different physical locations.
  • D. At the end of each session, SAS deletes the contents of all SAS libraries.
Answer:

B


vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 10

Assume that Sasuser.One does not exist and that the following SAS program is submitted at the
beginning of a new SAS session:
data sasuser.one;
x=1;
y=27;
output one; run;
Select one:

  • A. The data set Sasuser.One is created with 2 variables and 3 observations.
  • B. The data set Sasuser.One is created with 2 variables and 0 observations.
  • C. The data set Work.One is created with 2 variables and 1 observation.
  • D. The data set Sasuser.One is created with 2 variables and 1 observation.
Answer:

B


vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Page 1 out of 3
Viewing questions 1-10 out of 36
Go To
page 2