The following SAS
program is submitted:
data work.retail;
cost = ‘20000’;
total= .10* cost
run;
What is the result?
A. The value of the
variable TOTAL in the output data set is 2000. No messages are written to the
SAS log.
B. The value of the
variable TOTAL in the output data set is 2000. A note that conversion has taken
place is written to the SAS log
.
C. The value of the
variable TOTAL in the output data set is missing. An error message is written
to the SAS log.
D. The variable TOTAL
in the output data set has no value. The program fails to execute due to a syntax
error.
|
The following SAS
program is submitted:
data work.retail;
cost = '20000';
total = .10 * cost;
run;
Which one of the
following is the value of the variable TOTAL in the output data set?
A. 2000
B. '2000'
C. . (missing numeric
value)
D.
'
' (missing character value)
|
The following SAS
program is submitted:
What is the result?
A. The value of the
variable Discount in the output data set is 2000. No messages are written to the
SAS log.
B. The value of the
variable Discount in the output data set is 2000. A note that conversion has taken
place is written to the SAS log.
C. The value of the
variable Discount in the output data set is missing. A note in the SAS log
refers to invalid numeric data.
D. The variable
Discount in the output data set is set to zero. No messages are written to
the SAS log.
|
The
following SAS program is submitted:
data work.totalsales (keep =monthsales{12} );
set work.monthlysales (keep = year product sales);
array monthsales {12} ;
do i=1 to 12;
monthsales{i} = sales;
end;
run;
The
data set named WORK.MONTHLYSALES has one observation per month for each of
five
years
for a total of 60 observations.
Which
one of the following is the result of the above program?
A. The
program fails execution due to data errors.
B. The program
fails execution due to syntax errors.
C. The
program executes with warnings and creates the WORK.TOTALSALES data set.
D. The
program executes without errors or warnings and creates the WORK.TOTALSALES
dataset
|
The
following SAS program is submitted:
data work.totalsales;
set work.monthlysales(keep = year product sales);
retain monthsales {12} ;
array monthsales {12} ;
do i = 1 to
12;
monthsales{i}
= sales;
end;
cnt + 1;
monthsales{cnt} = sales;
run;
The
data set named WORK.MONTHLYSALES has one observation per month for each of
five
years
for a total of 60 observations.
Which
one of the following is the result of the above program?
A. The
program fails execution due to data errors.
B. The
program fails execution due to syntax errors.
C. The
program runs with warnings and creates the WORK.TOTALSALES data set with 60
observations.
D. The
program runs without errors or warnings and creates the WORK.TOTALSALES data
set
with 60
observations
|
data work.totalsales (keep =monthsales{12} );
set work.monthlysales (keep = year product sales);
array monthsales
{12} ;
do i=1 to
12;
monthsales{i} = sales;
end;
drop i;
run;
The program fails
execution due to syntax errors. What is the cause of the syntax error?
A. The variable
MONTHSALES does not exist.
B. An array cannot be
referenced on a KEEP data set option.
C. The KEEP= data set
option should be (KEEP = MONTHSALES).
D. The KEEP= data set
option should be the statement KEEP MONTHSALES{12}.
|
The following SAS
program is submitted:
data work.test;
Author = 'Agatha
Christie';
First = substr(scan(author,1,'
,'),1,1);
run;
Which one of the
following is the length of the variable FIRST in the output data set?
A. 1
B. 6
C. 15
D. 200
|
The following SAS
program is submitted:
data work.test;
Author = 'Christie,
Agatha';
First =
substr(scan(author,2,' ,'),1,1);
run;
Which one of the
following is the value of the variable FIRST in the output data set?
A. A
B. C
C. Agatha
D. ' ' (missing
character value)
|
The following SAS
program is submitted:
data one;
addressl = ‘214 London Way’;
run;
data one;
set one;
address = tranwrd(address1, ‘Way’,
‘Drive’); run;
What are the length
and value of the variable ADDRESS?
A. Length is 14; value
is ‘214 London Dri’.
B. Length is 14; value
is ‘214 London Way’.
C. Length is 16; value
is ‘214 London Drive’.
D. Length is 200;
value is ‘214 London Drive’.
|
The following SAS
program is submitted:
proc means data =
sasuser.shoes;
where product in
(‘Sandal’ , ‘Slipper’ , ‘Boot’);
run;
Which ODS
statements complete the program and send the report to an HTML file?
A. ods html =
‘sales.html’; ods html close;
B. ods file =
‘sales.html’; ods file close;
C. ods file html =
‘sales.html’; ods file close;
D. ods html file =
‘sales.html’; ods html close;
|
The following SAS
program is submitted:
<_insert_ods_code_>
proc means
data=SASUSER.SHOES;
where Product in
('Sandal' , 'Slipper' , 'Boot');
run;
<_insert_ods_code_>
Which ODS
statements inserted, respectively, in the two location above creates a report
stored in an html file?
A. ods html
open='sales.html';
ods html close;
B. ods
file='sales.html' / html;
ods file close;
C. ods html
file='sales.html';
ods html close;
D. ods file
html='sales.html';
ods
file close;
|
A raw data file is
listed below:
RANCH,1250,2,1,Sheppard
Avenue,"$64,000"
SPLIT,1190,1,1,Rand
Street,"$65,850"
CONDO,1400,2,1.5,Market
Street,"80,050"
TWOSTORY,1810,4,3,Garris
Street,"$107,250"
RANCH,1500,3,3,Kemble
Avenue,"$86,650"
SPLIT,1615,4,3,West
Drive,"94,450"
SPLIT,1305,3,1.5,Graham
Avenue,"$73,650"
The following SAS
program is submitted using the raw data file as input:
data
work.condo_ranch;
infile
'file-specification' dsd;
input style $ @;
if
style = 'CONDO' or style = 'RANCH' then
input sqfeet
bedrooms baths street $ price : dollar10.;
run;
How many
observations does the WORK.CONDO_RANCH data set contain?
A. 0
B. 3
C. 5
D. 7
|
A raw data file is
listed below:
RANCH,1250,2,1,Sheppard
Avenue,"$64,000"
SPLIT,1190,1,1,Rand
Street,"$65,850"
CONDO,1400,2,1.5,Market
Street,"80,050"
TWOSTORY,1810,4,3,Garris
Street,"$107,250"
RANCH,1500,3,3,Kemble
Avenue,"$86,650"
SPLIT,1615,4,3,West
Drive,"94,450"
SPLIT,1305,3,1.5,Graham
Avenue,"$73,650"
The following SAS
program is submitted using the raw data file as input:
data
work.condo_ranch;
infile
'file-specification' dsd;
input style $ @;
if style = 'CONDO'
or style = 'RANCH';
input sqfeet
bedrooms baths street $ price : dollar10.;
run;
How many
observations will the output data set contain?
A. 0
B. 3
C. 5
D.
7
|
Given the SAS data
set SASUSER.HOUSES:
Obs style bedrooms
baths price sqfeet street
1CONDO21.5800501200MAIN
2CONDO32.5793501300ELM
3CONDO42.51271501400OAK
4CONDO22.01107001100FIFTH
5TWOSTORY43.01072502100SECOND
6TWOSTORY21.0556501600WEST
7TWOSTORY21.0692501450NORTH
6TWOSTORY42.5102950
2000SOUTH
The following SAS
program is submitted:
proc report data =
sasuser.houses nowd headline;
column style price;
where price It
100000;
define price / mean
width = 9 format = dollar12.;
title;
run;
The following
output is desired:
styleprice
-------------
CONDO$79,700
TWOSTORY$62550
Which DEFINE
statement completes the program and produces the desired output?
A. define style /
width = 9,
B. define style /
order width = 9;
C. define style /
group width = 9;
D. define style /
display width = 9;
|
Given the following raw
data records in TEXTFILE.TXT:
John,FEB,13,25,14,27,Final
John,MAR,26,17,29,11,23,Current
Tina,FEB,15,18,12,13,Final
Tina,MAR,29,14,19,27,20,Current
The following output is
desired:
Obs
|
Name
|
Month
|
Status
|
Week1
|
Week2
|
Week3
|
Week4
|
Week5
|
1
|
John
|
FEB
|
Final
|
$13
|
$25
|
$14
|
$27
|
.
|
2
|
John
|
MAR
|
Current
|
$26
|
$17
|
$29
|
$11
|
$23
|
3
|
Tina
|
FEB
|
Final
|
$15
|
$18
|
$12
|
$13
|
.
|
4
|
Tina
|
MAR
|
Current
|
$29
|
$14
|
$19
|
$27
|
$20
|
Which SAS program correctly
produces the desired output?
A.
data
WORK.NUMBERS;
length
Name $ 4 Month $ 3 Status $ 7;
infile
‘TEXTFILE.TXT’ dsd;
input
Name $ Month $;
if
Month=’FEB’ then input Week1 Week2 Week3 Week4 Status $;
else
if Month=’MAR’ then input Week1 Week2 Week3 Week4 Week5 Status $;
format
Week1-Week5 dollar6.;
run; proc print data=WORK.NUMBERS; run;
B.
data
WORK.NUMBERS;
length
Name $ 4 Month $ 3 Status $ 7;
infile
‘TEXTFILE.TXT’ dlm=’,’ missover;
input
Name $ Month $;
if
Month=’FEB’ then input Week1 Week2 Week3 Week4 Status $;
else
if Month=’MAR’ then input Week1 Week2 Week3 Week4 Week5 Status $;
format
Week1-Week5 dollar6.;
run; proc print data=WORK.NUMBERS; run;
C.
data WORK.NUMBERS;
length Name $ 4 Month $ 3 Status $ 7;
infile
‘TEXTFILE.TXT’ dlm=’,’;
input
Name $ Month $ @;
if Month=’FEB’ then input Week1 Week2 Week3
Week4 Status $;
else if Month=’MAR’ then input Week1 Week2
Week3 Week4 Week5 Status $;
format Week1-Week5 dollar6.;
run;
proc print data=WORK.NUMBERS;
run;
D.
data
WORK.NUMBERS;
length
Name $ 4 Month $ 3 Status $ 7;
infile
‘TEXTFILE.TXT’ dsd @; input Name $
Month $;
if
Month=’FEB’ then input Week1 Week2 Week3 Week4 Status $;
else
if Month=’MAR’ then input Week1 Week2 Week3 Week4 Week5 Status $;
format
Week1-Week5 dollar6.; run;
proc print data=WORK.NUMBERS; run;
|
The following SAS
program is submitted:
data work.test;
First = 'Ipswich,
England';
City_Country =
substr(First,1,7)!!', '!!'England'; run;
Which one of the
following is the length of the variable CITY_COUNTRY in the output data set?
A. 6
B. 7
C. 17
D. 25
|
The
following SAS program is submitted:
data
work.test;
First =
'Ipswich, England';
City =
substr(First,1,7);
City_Country
= City!!', '!!'England'; run;
Which
one of the following is the value of the variable CITY_COUNTRY in the output
data set?
A. Ipswich!!
B. Ipswich,
England
C. Ipswich,
'England'
D. Ipswic h, England
|