Professional Documents
Culture Documents
SAS Certification Model Questions
SAS Certification Model Questions
data employee;
infile 'employee.dat'; /* Assuming directory-based system */
input id $6. name $20. @30 locale $10.;
run;
A. List
B. Column
C. Formatted
D. Mixed
E. Standard
1122334
1234567890123456789012345678901234567890
East Maryland Vermont Maine
Central Illinois Iowa Kansas Missouri
West California Washington
A.
data offices;
infile 'offices.dat' stopover;
input region $ state1-state4 $;
run;
B.
data offices;
1
infile 'offices.dat' missover;
input region $ (state1-state4) ($);
run;
C.
data offices;
infile 'offices.dat' delim=" ";
input region $ state1 $ state2 $ state3 $ state4 $;
run;
D.
data offices;
infile 'offices.dat';
input region $ state1-state4 $.;
run;
E. None of the above.
8. Given a data file with 100 columns of data, you only need to read
in the first 70 colums. Which of the
following could you use:
A. infile x line = 70;
B. infile x length = 71;
C. infile x missover = 70;
2
D. infile x ls=70;
E. infile x linesize=70;
3
If the DATA step below is executed, what will be the value of the
variable JOBDESC in the output SAS data
set when this observation is processed:
data navigate;
set employees;
if jobcode = 'NA1' then jobdesc = 'Navigator';
run;
A. navigator
B. Navigator
C. NAVIGATOR
D. a missing value
proc format;
value score 1 - 50 = 'Fail'
51 - 100 = 'Pass';
run;
4
LOOP?
A. x = 3, index = 3
B. x = 3, index = 4
C. x = 5, index = 5
D. x = 5, index = 6
E. x = 5, index = 7
data combine;
set one two;
run;
A. 10
B. 20
C. 0, the DATA step will fail due to syntax errors
D. 10 to 20, depending on how many observations match
4. Column Input style can read a character data value with space
embedding
a. True
b. False
5
5. A standard numeric data in SAS can contain a ‘-‘ (negative) sign
and ‘E’ for scientific notations
a. True
b. False
112233 SCODES Z M N
a. Z
b. Z M N
c. . (Missing)
Data Test;
INPUT accnum $ / fname $ lname $ ;
cards;
12223242 Johny Smith
Peter Smith Thomas Joseph
;run;
6
9. The following statement is submitted:
Data Test;
INPUT accnum $ #2 fname $ lname $ ;
cards;
12223242 Johny Smith
Peter Smith Thomas Joseph
;run;
a. Data Test;
INFILE 'c:\mydata.dat' MISSOVER;
INPUT accnum $ 1-6 fname $ 8-14 lname $ 16-20;
run;
b. Data Test;
INFILE 'c:\mydata.dat' TRUNCOVER;
7
INPUT accnum $ 1-6 fname $ 8-14 lname $ 16-20;
run;
c. Data Test;
INFILE 'c:\mydata.dat' ;
INPUT accnum $ fname $ lname $;
run;
Data Test;
INFILE 'c:\mydata.dat’;
INPUT client_id $ 1-3 @;
IF client_id 'JCP' then delete;
INPUT accnum $ 4-8 fname $ 9-14 lname $ 16-20;
run;
a. None
b. 3
c. 4
13. An external data file has account open date in the following
format .
01-13-95
01-14-96
01-15-97
Data Test;
today = '20dec2005'd;
format today mmddyy10.;
run;
8
a. ‘Today’ variable displays like ‘12/20/2005’
b. Data step not executed due to wrong format ‘mmddyy’.
c. Today is displayed as ‘20DEC2005’
Data Test;
INFILE 'c:\mydata.dat' DLM='$' DSD ;
9
INPUT accnum $ fname $ lname $;
run;
a. It does not treat ‘$’ character as part of the data value and treat
it as delimiter.
b. It recognize two consecutive ‘$’ characters as a missing value for
the variable read
c. If data value is specified in quotes with embedded ‘$’ character
DSD option treats it as part of the data.
a. It lists all SAS data files with file size and date modified in ‘mylib’
library and makes a copy of ‘scoredata’ file in ‘rloc’ library and
deletes ‘tension’ dataset..
b. It lists all SAS data files with file size and date modified in ‘mylib’
library and deletes ‘tension’ file from ‘rloc’ library.
c. It lists all SAS data files with file size and date modified in ‘mylib’
library and makes a copy of ‘scoredata’ file in ‘rloc’ library and also
copies the ‘scoredata’ file in ‘rloc’ library.
d. It lists all sas data files with file size and date modified in ‘mylib’
library and makes a copy of ‘scoredata’ file in ‘rloc’ library.
10
Data xx;
Set yy;
attrib status_codes length=$4 label ='Status Codes' format
=$upcase8.;
run;
a. YES
b. NO
c. No Sufficient Information
A) Data target_data ;
Set base_data((keep = var1 var2 var3 );
Run;
B) Data target_data ;
Set base_data;
keep = var1 var2 var3 ;
Run;
If the user needs only var1, var2 and var3 to work with, which step
is most efficient?
a. A
b. B
c. C
d. A&B
e. None
Data test;
SET os_dollars END=FIN ;
11
BY client_group;
t_os +os;
IF LAST.clinet_group THEN DO ;
g_os +t_os ;
t_os=0;END;run;
data new(drop=x);
set temp(rename=(my_number=x));
my_number=input(x,best4.);run;
A) Obs my_number
1 1234
2 9
B) Obs my_number
1 1234
2 0009
C) Obs my_number
. .
x='20jan94'd;
y=qtr(x);
put y=;
12
What value would be printed to the SAS log?
a. 1
b. 2
c. 3
d. None
data xx;
date1=122591;
date2=put(date1,z6.);run;
11. The following statement forms a part of SAS dataset (no syntax
errors)
Data xx;
Set yy;
array weight wt1-wt50;
do i=1 to 50;
if weight{i}=999 then weight{i}=’missing’;
end;
run;
13
define s_g /group;
run;
14