Beruflich Dokumente
Kultur Dokumente
SAS Certification
TIPS AND TRICKS
SAS BASE CERTIFICATION EXAM
PRACTICAL EXAM SAMPLE
INFO CONTENT QUESTIONS
KULeuven
17/10/2017
Ilse Scheys
SAS Technical Trainer
Copyright © 2010, SAS Institute Inc. All rights reserved. C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
1
10/16/2017
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
2
10/16/2017
# of questions
70 # of questions
per page? 1
multiple-choice
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
3
10/16/2017
When do you
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
4
10/16/2017
• Date:
Tuesday November 7th 2017
• Time:
16:15 – 18:30
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
including You can download the SAS Flash Cards iOS app:
Preparation • sample questions (and answers) Preparation • Download the SAS Flash Cards
• more decks > SAS > SAS Programming to access the deck.
For • flash cards
For
Exam Exam
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
5
10/16/2017
SAS Certification
• 50 questions
Simulation
exam • Correct answers with explanations
PRACTICAL EXAM SAMPLE
INFO CONTENT QUESTIONS
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
6
10/16/2017
QUESTION 1
REVIEW OF CONCEPTS
TOPIC 1: ACCESSING DATA
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 1 QUESTION 2
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
7
10/16/2017
SOLUTION 2 QUESTION 3
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 3 QUESTION 4
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
8
10/16/2017
SOLUTION 4 QUESTION 5
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
Date values
▪ create and manipulate
CREATING ▪ informats
DATA ▪ YEARCUTOFF system option
STRUCTURES Control Observations & Variables
▪ WHERE, DROP and KEEP statements
▪ DROP=, KEEP= and OBS= options
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
9
10/16/2017
QUESTION 6
REVIEW OF CONCEPTS
TOPIC 2: CREATING DATA STRUCTURES
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 6 QUESTION 7
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
10
10/16/2017
SOLUTION 7 QUESTION 8
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 8 QUESTION 9
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
11
10/16/2017
SOLUTION 9 QUESTION 10
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 10 TOPIC 3
PART 1
SAS Libraries
▪ LIBNAME statement
Variable attributes
▪ variable name, length, type
MANAGING ▪ format, label
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
12
10/16/2017
▪ Iterative:
▪ DO loops (also nested and conditional)
REVIEW OF CONCEPTS
▪ 1-dim arrays: ARRAY statement, DO loop TOPIC 3: MANAGING DATA
MANAGING Manipulate and convert data
DATA ▪ Character functions
▪ Numeric functions
▪ PUT and INPUT function
QUESTION 11 SOLUTION 11
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
13
10/16/2017
QUESTION 12 SOLUTION 12
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 13 SOLUTION 13
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
14
10/16/2017
QUESTION 14 SOLUTION 14
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 15 SOLUTION 15
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
15
10/16/2017
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
4. In the data set Invest, what would be the stored value 4. In the data set Invest, what would be the stored value
for Year? for Year?
data invest; data invest;
a. missing do Year=2008 to 2012; a. missing do Year=2008 to 2012;
b. 2008 Capital+5000; b. 2008 Capital+5000;
c. 2012 Capital+(Capital*.03); c. 2012 Capital+(Capital*.03);
end; end;
d. 2013 run; d. 2013 run;
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
16
10/16/2017
TOPIC 4
PRINT procedure
▪ VAR, SUM, WHERE, ID, BY statements
Enhance reports
▪ Formats and labels
REVIEW OF CONCEPTS
TOPIC 4: GENERATING REPORTS
GENERATING ▪ Titles and footnotes
System options
Summary reports
▪ FREQ procedure
▪ MEANS procedure
▪ UNIVARIATE procedure
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 17 SOLUTION 17
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
17
10/16/2017
QUESTION 18 SOLUTION 18
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 19 SOLUTION 19
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
18
10/16/2017
QUESTION 20 SOLUTION 20
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
TOPIC 5
Syntax errors
▪ misspelled keywords
▪ unmatched quotation marks
▪ missing semicolon
▪ invalid options
REVIEW OF CONCEPTS
TOPIC 5: HANDLING ERRORS
HANDLING Data errors
ERRORS ▪ character values stored in a numeric
variable
Logic errors
▪ SAS cannot detect these errors
▪ PUTLOG statement
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
19
10/16/2017
QUESTION 21 SOLUTION 21
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 22 SOLUTION 22
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
20
10/16/2017
QUESTION 23 SOLUTION 23
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 24 SOLUTION 24
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
21
10/16/2017
QUESTION 25 SOLUTION 25
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 1
A. BLANK
PRACTICAL
INFO
EXAM
CONTENT
SAMPLE
QUESTIONS
B. MISSING
C. 0
D. THERE ARE NO OBSERVATIONS.
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
22
10/16/2017
SOLUTION 1 QUESTION 2
At the start of DATA step processing, during the Suppose the YEARCUTOFF= system option is set
compilation phase, variables are created in the to its default value 1920. Which MDY function
program data vector, and observations are set to:
creates the date value for January 3, 2020?
A. BLANK
A. MDY(1,3,20)
B. MISSING
B. MDY(3,1,20)
C. 0
C. MDY(1,3,2020)
D. THERE ARE NO OBSERVATIONS.
D. MDY(3,1,2020)
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
QUESTION 2 QUESTION 3
Suppose the YEARCUTOFF= system option is set In order for the date values 05MAY1955 and
to its default value 1920. Which MDY function 04MAR2046 to be read correctly, what value must
the YEARCUTOFF= option have?
creates the date value for January 3, 2020?
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
23
10/16/2017
SOLUTION 3 QUESTION 4
In order for the date values 05MAY1955 and What happens when you submit the following
program? PROC SORT DATA=CLINIC.DIABETES;
04MAR2046 to be read correctly, what value must RUN;
the YEARCUTOFF= option have? PROC PRINT DATA=CLINIC.DIABETES;
VAR AGE HEIGHT WEIGHT PULSE;
WHERE SEX='F';
RUN;
A. A VALUE BETWEEN 1947 AND 1954, INCLUSIVE A. The PROC PRINT step runs successfully, printing observations
in their sorted order.
B. 1955 OR HIGHER
As long as you specify an informat with B. The PROC SORT step permanently sorts the input data set.
C. 1946 OR HIGHER the correct field width for reading the C. The PROC SORT step generates errors and stops processing, but
entire date value, the PROC PRINT step runs successfully, printing observations
D. ANY VALUE the YEARCUTOFF= option does not in their original (unsorted) order.
affect date values that have four-digit
years. D. The PROC SORT step runs successfully, but the PROC PRINT step
generates errors and stops processing.
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 4 QUESTION 5
What happens when you submit the following If you submit the following program, which output
program? PROC SORT DATA=CLINIC.DIABETES; does it create?
RUN;
PROC SORT DATA=FINANCE.LOANS OUT=WORK.LOANS;
PROC PRINT DATA=CLINIC.DIABETES; BY MONTHS AMOUNT;
VAR AGE HEIGHT WEIGHT PULSE; RUN;
WHERE SEX='F';
RUN; PROC PRINT DATA=WORK.LOANS NOOBS;
VAR MONTHS;
A. The PROC PRINT step runs successfully, printing observations SUM AMOUNT PAYMENT;
in their sorted order. WHERE MONTHS<360;
RUN;
B. The PROC SORT step permanently sorts the input data set.
C. The PROC SORT step generates errors and stops processing, but
the PROC PRINT step runs successfully, printing observations
in their original (unsorted) order.
D. The PROC SORT step runs successfully, but the PROC PRINT step
generates errors and stops processing.
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
24
10/16/2017
SOLUTION 5 QUESTION 6
If you submit the following program, which output Which of the following statements is false
does it create? regarding this program?
PROC SORT DATA=FINANCE.LOANS OUT=WORK.LOANS; DATA WORK.INVEST;
BY MONTHS AMOUNT; DO YEAR=1990 TO 2004;
RUN; CAPITAL+5000;
PROC PRINT DATA=WORK.LOANS NOOBS; CAPITAL+(CAPITAL*.10);
VAR MONTHS; OUTPUT;
SUM AMOUNT PAYMENT; END;
WHERE MONTHS<360; RUN;
RUN;
A. The OUTPUT statement writes current values to the data
set immediately.
B. The last value for Year in the new data set is 2005.
C. The OUTPUT statement overrides the automatic output at
the end of the DATA step.
D. The DO loop performs 15 iterations.
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 6 QUESTION 7
Which of the following statements is false Which statement identifies a raw data fileref
regarding this program? Products and specifies that the DATA step read
DATA WORK.INVEST; only records 1-15?
DO YEAR=1990 TO 2004;
CAPITAL+5000;
CAPITAL+(CAPITAL*.10);
OUTPUT;
END;
RUN; A. INFILE PRODUCTS OBS 15;
A. The OUTPUT statement writes current values to the data B. INFILE PRODUCTS OBS=15;
set immediately.
B. The last value for Year in the new data set is 2005.
C. INPUT PRODUCTS OBS=15;
C. The OUTPUT statement overrides the automatic output at D. INPUT PRODUCTS 1-15;
the end of the DATA step.
D. The DO loop performs 15 iterations.
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
25
10/16/2017
SOLUTION 7 QUESTION 8
Which statement identifies a raw data fileref What is the length of the variable Type, as created
Products and specifies that the DATA step read in the DATA step below?
only records 1-15? DATA FINANCE.NEWLOAN;
SET FINANCE.RECORDS;
TOTLOAN+PAYMENT;
IF CODE='1' THEN TYPE='FIXED';
ELSE TYPE='VARIABLE';
A. INFILE PRODUCTS OBS 15; LENGTH TYPE $ 10;
RUN;
B. INFILE PRODUCTS OBS=15; A. 5
C. INPUT PRODUCTS OBS=15; B. 8
D. INPUT PRODUCTS 1-15; C. 10
D. it depends on the first value of Type
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 8 QUESTION 9
What is the length of the variable Type, as created Which INPUT statement correctly reads the
in the DATA step below? character values for modelnumber (1st field) after
DATA FINANCE.NEWLOAN; the values for item (2nd field)?
SET FINANCE.RECORDS;
TOTLOAN+PAYMENT;
IF CODE='1' THEN TYPE='FIXED';
ELSE TYPE='VARIABLE';
LENGTH TYPE $ 10;
RUN;
A. INPUT +7 ITEM $9. @1 MODELNUMBER $5.;
A. 5
B. INPUT +6 ITEM $9. @1 MODELNUMBER $5.;
B. 8
C. INPUT @7 ITEM $9. +1 MODELNUMBER $5.;
C. 10
D. INPUT @7 ITEM $9 @1 MODELNUMBER 5.;
D. it depends on the first value of Type
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
26
10/16/2017
SOLUTION 9 QUESTION 10
Which INPUT statement correctly reads the For the observation shown below, what is the result
character values for modelnumber (1st field) after the of the IF-THEN statement?
values for item (2nd field)? Status Type Count Action Control
ok 3 12 E Go
QUESTION 10 QUESTION 11
For the observation shown below, what is the result Given the following data set Prodline,
of the IF-THEN statement? the following SAS program is submitted:
ID COLOR PRICE DATA PRODUCTS;
Status Type Count Action Control 123 Blue 283 SET PRODLINE;
234 Red 250 IF PRICE > 250;
ok 3 12 E Go 345 Blue 500 INCREASE = PRICE * .10;
RUN;
IF STATUS=‘OK’ AND TYPE=3 THEN COUNT+1;
IF STATUS=‘S’ OR ACTION=‘E’ THEN CONTROL=‘STOP’; What is the value of increase for observation 2 in
the data set Products?
A. COUNT=12 CONTROL=GO A. 25
B. COUNT=13 CONTROL=STOP B. 50
C. COUNT=12 CONTROL=STOP C. 28.3
D. COUNT=13 CONTROL=GO D. THE PROGRAM FAILS TO EXECUTE BECAUSE THE
IF STATEMENT IS MISSING A THEN.
1
0
7C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
27
10/16/2017
SOLUTION 11 QUESTION 12
Given the following data set Prodline, How many variables are created,
the following SAS program is submitted: given the following submitted SAS program?
ID COLOR PRICE DATA PRODUCTS;
123 Blue 283 SET PRODLINE; DATA EMPLOYEES;
IF PRICE > 250; INFILE 'FILE-SPECIFICATION';
234 Red 250
INCREASE = PRICE * .10; INPUT @1 NAME $10.
345 Blue 500 @15 DATE DATE9
RUN;
@25 DEPARTMENT $;
RUN;
What is the value of increase for observation 2 in
the data set Products?
A. 0
A. 25
B. 1
B. 50
C. 3
C. 28.3
D. 4
D. THE PROGRAM FAILS TO EXECUTE BECAUSE THE
IF STATEMENT IS MISSING A THEN.
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
SOLUTION 12 QUESTION 13
How many variables are created, Given the following data set EMPLOYEE,
given the following submitted SAS program? the following SAS program is submitted:
DATA TEST;
Ruth 39 11 INFILE 'EMPLOYEE';
DATA EMPLOYEES; Jose 32 22
INFILE 'FILE-SPECIFICATION'; INPUT EMPLOYEE_NAME $ 1-4;
Sue 30 33 IF EMPLOYEE_NAME = 'Sue'
INPUT @1 NAME $10.
@15 DATE DATE9 John 40 44 THEN INPUT AGE 7-8;
@25 DEPARTMENT $; ELSE INPUT IDNUM 10-11;
RUN; RUN;
What value does the variable AGE contain when
A. 0 the name of the employee is “Sue”?
B. 1 A. 30
C. 3 B. 33
D. 4 C. 40
D. . (MISSING NUMERIC VALUE)
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
28
10/16/2017
SOLUTION 13 QUESTION 14
QUESTION 14
Which SAS informat should you use to read these Good luck!
dates?
1. Study
A. DATE6. 2. Review the exam content
B. DATE8. 3. Make the simulation exam
C. MMDDYY6. Learn from your mistakes
D. MMDDYY8. Revise the topics until you understand them
4. Practice a lot
Trial and error
Check the log
5. Focus points: error handling, PDV, raw data
6. Read the questions carefully
C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d . C o p y r i g h t © 2 0 1 6 , S A S I n s t i t u t e I n c . A l l r i g h t s r e s e r ve d .
C o p y r i g h t © 2 0 1 6 , S AS I n s t i t u t e I n c . Al l r i g h t s r e s e r v e d .
29