Friday, March 2, 2012


Which attributes or options are reflected in this PROC REPORT output?
style         SqFeet           Price
------------------------------------
                                    
 RANCH             720       $34,550
TWOSTORY          1040       $55,850
 SPLIT            1190       $65,850
TWOSTORY          1240       $69,250
 RANCH            1250       $64,000
 SPLIT            1305       $73,650
 CONDO            1390       $79,350
 CONDO            1400       $80,050
 RANCH            1500       $86,650
 RANCH            1535       $89,100
 SPLIT            1615       $94,450
TWOSTORY          1745      $102,950
TWOSTORY          1810      $107,250
 CONDO            1860      $110,700
 CONDO            2105      $127,150
a.     SKIPLINE and FORMAT=
b.    CENTER, HEADLINE, HEADSKIP, and either WIDTH=, SPACING=, or FORMAT=
c.     SPACING= only
d.    CENTER, FORMAT=, and HEADLINE
To create a summary report that shows the average number of bedrooms and the maximum number of baths for each style of house, which DEFINE statements do you use in your PROC REPORT step?
a.     define style / center 'Style of/House';
b.    define bedrooms / mean 'Average/Bedrooms';
c.     define baths / max 'Maximum/Baths';
d.    define style / group;
e.     define bedrooms / mean 'Average/Bedrooms';
f.      define baths / max 'Maximum/Baths';
g.    define style / order;
h.    define bedrooms / mean 'Average/Bedrooms';
i.      define baths / max 'Maximum/Baths';
j.      define style / group;
k.     define bedrooms / 'Average/Bedrooms';
l.      define baths / 'Maximum/Baths'
Which program does not contain an error?
a.     proc report data=sasuser.houses nowd;
b.        column style bedrooms baths;
c.         define style / order;
d.        define bedbathratio / computed format=4.2;
e.         compute bedbathratio;
f.             bedbathratio=baths.sum/bedrooms.sum;
g.        endcomp;
h.    run;
i.      proc report data=sasuser.houses nowd;
j.          column style bedrooms baths BedBathRatio;
k.         define style / order;
l.          define bedbathratio / order format=4.2;
m.       compute bedbathratio;
n.           bedbathratio=baths.sum/bedrooms.sum;
o.        endcomp;
p.    run;
q.    proc report data=sasuser.houses nowd;
r.         column style bedrooms baths BedBathRatio;
s.         define style / order;
t.          define bedbathratio / computed format=4.2;
u.        compute bedbathratio;
v.            bedbathratio=baths.sum/bedrooms.sum;
w.        endcomp;
x.     run;
y.     proc report data=sasuser.houses nowd;
z.         column style bedrooms baths BedBathRatio;
aa.      define style / order;
bb.      define bedbathratio / computed format=4.2;
cc.      compute bedbathratio;
dd.         bedbathratio=baths/bedrooms;
ee.      endcomp;
ff.    run;
What output does this PROC REPORT step produce?
proc report data=sasuser.houses nowd;
   column style sqfeet bedrooms price;
run;
a.     a list report ordered by values of the first variable in the COLUMN statement
b.    a summary report ordered by values of the first variable in the COLUMN statement
c.     a list report that displays a row for each observation in the input data set and which calculates the SUM statistic for numeric variables
d.    a list report that calculates the N (frequency) statistic for character variables
Which of the following programs produces this output?
Style

CONDO
RANCH
SPLIT
TWOSTORY
Average Price
4
4
3
4
$82,720
a.     proc report data=sasuser.houses nowd;
b.        column style condo range split
c.                twostory price;
d.     
e.         define price / mean 'Average Price';
f.      run;
g.    proc report data=sasuser.houses nowd;
h.        column style price;
i.          define style / group;
j.          define price / mean 'Average Price';
k.     run;
l.      proc report data=sasuser.houses nowd;
m.       column style price;
n.        define style / across;
o.        define price / mean 'Average Price';
p.    run;
q.    proc report data=sasuser.houses nowd;
r.         column style price;
s.         define style / across 'CONDO' 'RANCH'
t.                'SPLIT' 'TWOSTORY';
u.        define price / mean 'Average Price';
v.     run;
If you submit this program, where does your PROC REPORT output appear?
proc report data=sasuser.houses nowd;
   column style sqfeet bedrooms price;
   define style / group;
run;
a.     in the PROC REPORT window
b.    as HTML and/or SAS listing output
c.     both of the above
d.    neither of the above
How can you create output with headings that break as shown below?
style of    Average       Maximum
 House     Bedrooms         Baths
 CONDO         2.75           2.5
 RANCH         2.25             3
 SPLIT     2.666666             3
TWOSTORY          3             3
a.     You must specify the SPLIT= option in the PROC REPORT statement and use the split character in column headings in DEFINE statements.
b.    You must use the default split character in column headings in DEFINE statements.
c.     You must specify either the WIDTH= or the SPACING= attribute in DEFINE statements.
d.    These headings split this way by default.
Suppose you want to create a report using both character and numeric variables. If you don't use any DEFINE statements in your PROC REPORT step,
a.     your PROC REPORT step will not execute successfully.
b.    you can produce only list reports.
c.     you can order rows by specifying options in the PROC REPORT statement.
d.    you can produce only summary reports.
The default statistics produced by the MEANS procedure are n-count, mean, minimum, maximum, and
a.     median.
b.    range.
c.     standard deviation.
d.    standard error of the mean.
Which statement will limit a PROC MEANS analysis to the variables Boarded, Transfer, and Deplane?
a.     by boarded transfer deplane;
b.    class boarded transfer deplane;
c.     output boarded transfer deplane;
d.    var boarded transfer deplane;
The data set Survey.Health includes the following variables. Which is a poor candidate for PROC MEANS analysis?
a.     IDnum
b.    Age
c.     Height
d.    Weight
Which of the following statements is true regarding BY-group processing?
a.     BY variables must be either indexed or sorted.
b.    Summary statistics are computed for BY variables.
c.     BY-group processing is preferred when you are categorizing data that contains few variables.
d.    BY-group processing overwrites your data set with the newly grouped observations.
Which group processing statement produced the PROC MEANS output shown below?
Survive
Sex
N Obs
Variable
N
Mean
Std Dev
Minimum
Maximum
DIED
1
4
Arterial
4
92.5
10.5
83.0
103.0
Heart
4
111.0
53.4
54.0
183.0
Cardiac
4
176.8
75.2
95.0
260.0
Urinary
4
98.0
186.1
0.0
377.0

2
6
Arterial
6
94.2
27.3
72.0
145.0
Heart
6
103.7
16.7
81.0
130.0
Cardiac
6
318.3
102.6
156.0
424.0
Urinary
6
100.3
155.7
0.0
405.0
SURV
1
5
Arterial
5
77.2
12.2
61.0
88.0
Heart
5
109.0
32.0
77.0
149.0
Cardiac
5
298.0
139.8
66.0
410.0
Urinary
5
100.8
60.2
44.0
200.0

2
5
Arterial
5
78.8
6.8
72.0
87.0
Heart
5
100.0
13.4
84.0
111.0
Cardiac
5
330.2
87.0
256.0
471.0
Urinary
5
111.2
152.4
12.0
377.0
a.     class sex survive;
b.    class survive sex;
c.     by sex survive;
d.    by survive sex;
Which program can be used to create the following output?
Sex
N Obs
Variable
N
Mean
Std Dev
Minimum
Maximum
F
11
Age
11
48.9090909
13.3075508
16.0000000
63.0000000
Height
11
63.9090909
2.1191765
61.0000000
68.0000000
Weight
11
150.4545455
18.4464828
102.0000000
168.0000000
M
9
Age
9
44.0000000
12.3895117
15.0000000
54.0000000
Height
9
70.6666667
2.6457513
66.0000000
75.0000000
Weight
9
204.2222222
30.2893454
140.0000000
240.0000000
a.     proc means data=clinic.diabetes;
b.         var age height weight;
c.          class sex;
d.         output out=work.sum_gender
e.            mean=AvgAge AvgHeight AvgWeight;
f.      run;
g.    proc summary data=clinic.diabetes print;
h.        var age height weight;
i.          class sex;
j.          output out=work.sum_gender
k.           mean=AvgAge AvgHeight AvgWeight;
run;
l.      proc means data=clinic.diabetes noprint;
m.       var age height weight;
n.         class sex;
o.         output out=work.sum_gender
p.           mean=AvgAge AvgHeight AvgWeight;
q.    run;
r.     Both a and b.
By default, PROC FREQ creates a table of frequencies and percentages for which data set variables?
a.     character variables
b.    numeric variables
c.     both character and numeric variables
d.    none: variables must always be specified
Frequency distributions work best with variables that contain
a.     continuous values.
b.    numeric values.
c.     categorical values.
d.    unique values.
Which PROC FREQ step produced this two-way table?
Image from book
a.     proc freq data=clinic.diabetes;
b.         tables height weight;
c.          format height htfmt. weight wtfmt.;r
d.    un;
e.     proc freq data=clinic.diabetes;
f.           tables weight height;
g.         format weight wtfmt. height htfmt.;
h.    run;
i.      proc freq data=clinic.diabetes;
j.           tables height*weight;
k.          format height htfmt. weight wtfmt.;
l.      run;
m.   proc freq data=clinic.diabetes;
n.         tables weight*height;
o.         format weight wtfmt. height htfmt.;
p.    run;
Which PROC FREQ step produced this table?
Image from book
a.     proc freq data=clinic.diabetes;
b.          tables sex weight / list;
c.           format weight wtfmt.; 
d.    run;
e.     proc freq data=clinic.diabetes;
f.            tables sex*weight / nocol;
g.          format weight wtfmt.; 
h.    run;
i.      proc freq data=clinic.diabetes;
j.            tables sex weight / norow nocol;
k.           format weight wtfmt.; 
l.      run;
m.   proc freq data=clinic.diabetes;
n.          tables sex*weight / nofreq norow nocol;
o.         format weight wtfmt.; 
p.    run;
Using ODS statements, how many types of output can you generate concurrently?
a.     1 (only listing output)
b.    2
c.     3
d.    as many as you want
If ODS is set to its default settings, what types of output are created by the code below?
ods html file='c:\myhtml.htm';
ods pdf file='c:\mypdf.pdf';
a.     HTML and PDF
b.    PDF only
c.     HTML, PDF, and listing
d.    No output is created because ODS is closed by default.
What is the purpose of closing the Listing destination in the code shown below?
ods listing close;
ods html ... ;
a. It conserves system resources.
b. It simplifies your program.
c. It makes your program compatible with other hardware platforms.
d. It makes your program compatible with previous versions of SAS software.
When the code shown below is run, what will the file D:\Output\body.html contain?
ods html body='d:\output\body.html';
proc print data=work.alpha;
run;
proc print data=work.beta;
run;
ods html close;
a.     The PROC PRINT output for Work.Alpha.
b.    The PROC PRINT output for Work.Beta.
c.     The PROC PRINT output for both Work.Alpha and Work.Beta.
d.    Nothing. No output will be written to D:\Output\body.html.
When the code shown below is run, what file will be loaded by the links in D:\Output\contents.html?
ods html body='d:\output\body.html'
         contents='d:\output\contents.html'
         frame='d:\output\frame.html';
a.     D:\Output\body.html
b.    D:\Output\contents.html
c.     D:\Output\frame.html
d.    There are no links from the file D:\Output\contents.html.
The table of contents created by the CONTENTS= option contains a numbered heading for
a.     each procedure.
b.    each procedure that creates output.
c.     each procedure and DATA step.
d.    each HTML file created by your program.
When the code shown below is run, what will the file D:\Output\frame.html display?
ods html body='d:\output\body.html'
         contents='d:\output\contents.html'
         frame='d:\output\frame.html';
a.     The file D:\Output\contents.html.
b.    The file D:\Output\frame.html.
c.     The files D:\Output\contents.html and D:\Output\body.html.
d.    It displays no other files.
What is the purpose of the URL= suboptions shown below?
ods html body='d:\output\body.html' (url='body.html')
         contents='d:\output\contents.html' (url='contents.html')
         frame='d:\output\frame.html';
a.     To create absolute link addresses for loading the files from a server.
b.    To create relative link addresses for loading the files from a server.
c.     To allow HTML files to be loaded from a local drive.
d.    To send HTML output to two locations.
Which ODS HTML option was used in creating the following table?
Image from book
a.     format=brown
b.    format='brown'
c.     style=brown
d.    style='brown'
What is the purpose of the PATH= option?
ods html path='d:\output' (url=none)
         body='body.html'
         contents='contents.html'
         frame='frame.html';
a.     It creates absolute link addresses for loading HTML files from a server.
b.    It creates relative link addresses for loading HTML files from a server.
c.     It allows HTML files to be loaded from a local drive.
d.    It specifies the location of HTML file output.
Which program creates the output shown below?
Image from book
StockNum
Finish
Style
Item
TotalPrice
310
oak
pedestal
table
329.99
311
maple
pedestal
table
699.98
312
brass
floor
lamp
779.97
313
glass
table
lamp
839.96
a.     data test2;
b.        infile furnture;
c.         input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18
d.            Item $ 20-24 Price 26-31;
e.         if finish='oak' then delete;
f.          retain TotPrice 100;
g.        totalprice+price;
h.        drop price;
i.      run;
j.      proc print data=test2 noobs;
k.     run;
l.      data test2;
m.       infile furnture;
n.        input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18
o.            Item $ 20-24 Price 26-31;
p.        if finish='oak' and price<200 then delete;
q.        TotalPrice+price;
r.     run;
s.     proc print data=test2 noobs;
t.      run;
u.    data test2(drop=price);
v.         infile furnture;
w.        input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18
x.             Item $ 20-24 Price 26-31;
y.         if finish='oak' and price<200 then delete;
z.         TotalPrice+price;
aa.  run;
bb.  proc print data=test2 noobs;
cc.  run;
dd.  data test2;
ee.      infile furnture;
ff.        input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18
gg.          Item $ 20-24 Price 26-31;
hh.      if finish=oak and price<200 then delete price;
ii.        TotalPrice+price;
jj.    run;
kk.  proc print data=test2 noobs;
ll.    run;
How is the variable Amount labeled and formatted in the PROC PRINT output?
data credit;
   infile creddata;
   input Account $ 1-5 Name $ 7-25 Type $ 27
         Transact $ 29-35 Amount 37-50;
   label amount='Amount of Loan';
   format amount dollar12.2;
  
run;
proc print data=credit label;
    label amount='Total Amount Loaned';
   format amount comma10.;
run;
a.     label Amount of Loan, format DOLLAR12.2
b.    label Total Amount Loaned, format COMMA10.
c.     label Amount, default format
d.    The PROC PRINT step does not execute because two labels and two formats are assigned to the same variable.
Consider the IF-THEN statement shown below. When the statement is executed, which expression is evaluated first?
if finlexam>=95
   and (research='A' or
       (project='A' and present='A'))
   then Grade='A+';
a.     finlexam>=95
b.    research='A'
c.     project='A' and present='A'
d.    research='A' or
(project='A' and present='A')
Consider the small raw data file and program shown below. What is the value of Count after the fourth record is read?
Image from book
a.     missing
b.    0
c.     30
d.    70
Now consider the revised program below. What is the value of Count after the third observation is read?
Image from book
a.     missing
b.    0
c.     100
d.    130
For the observation shown below, what is the result of the IF-THEN statement?
Status
Type
Count
Action
Control
ok
3
12
E
Go
if status='OK' and type=3
   then Count+1;
if status='S' or action='E'
   then Control='Stop';
a.     Count = 12 Control = Go
b.    Count = 13 Control = Stop
c.     Count = 12 Control = Stop
d.    Count = 13 Control = Go
Which of the following can determine the length of a new variable?
a.     the length of the variable's first value
b.    the assignment statement
c.     the LENGTH statement
d.    all of the above
Which set of statements is the most efficient equivalent to the code shown below?
if code='1' then Type='Fixed';
if code='2' then Type='Variable';
if code^='1' and code^='2' then Type='Unknown';
a.     if code='1' then Type='Fixed';
b.    else if code='2' then Type='Variable';
c.     else Type='Unknown';
d.    if code='1' then Type='Fixed';
e.     if code='2' then Type='Variable';
f.      else Type='Unknown';
g.    if code='1' then type='Fixed';
h.    else code='2' and type='Variable';
i.      else type='Unknown';
j.      if code='1' and type='Fixed';
k.     then code='2' and type='Variable';
l.      else type='Unknown';
What is the length of the variable Type, as created in the DATA step below?
data finance.newloan;
   set finance.records;
   TotLoan+payment;
   if code='1' then Type='Fixed';
   else Type='Variable';
   length type $ 10;
run;
a.     5
b.    8
c.     10
d.    It depends on the first value of Type.
Which program contains an error?
a.     data clinic.stress(drop=timemin timesec);
b.        infile tests;
c.         input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33
d.              RecHR 35-37 TimeMin 39-40 TimeSec 42-43
e.               Tolerance $ 45;
f.          TotalTime=(timemin*60)+timesec;
g.        SumSec+totaltime;
h.    run;
i.      proc print data=clinic.stress;
j.          label totaltime='Total Duration of Test';
k.         format timemin 5.2;
l.          drop sumsec;
m.   run;
n.    proc print data=clinic.stress(keep=totaltime timemin);
o.        label totaltime='Total Duration of Test';
p.        format timemin 5.2;
q.     
r.     run; data clinic.stress;
s.         infile tests;
t.          input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33
u.              RecHR 35-37 TimeMin 39-40 TimeSec 42-43
v.               Tolerance $ 45;
w.        TotalTime=(timemin*60)+timesec;
x.         keep id totaltime tolerance;
y.     run;
If you submit the following program, which variables appear in the new data set?
data work.cardiac(drop=age group);
   set clinic.fitness(keep=age weight group);
   if group=2 and age>40;
run;
a.     none
b.    Weight
c.     Age, Group
d.    Age, Weight, Group
Which of the following programs correctly reads the data set Orders and creates the data set FastOrdr?
a.     data catalog.fastordr(drop=ordrtime);
b.        set july.orders(keep=product units price);
c.         if ordrtime<4;
d.        Total=units*price;
e.     run;
f.      data catalog.orders(drop=ordrtime);
g.        set july.fastordr(keep=product units price);
h.       if ordrtime<4;
i.          Total=units*price;
j.      run;
k.     data catalog.fastordr(drop=ordrtime);
l.          set july.orders(keep=product units price
m.                       ordrtime);
n.        if ordrtime<4;
o.        Total=units*price;
p.    run;
q.    none of the above
Which of the following statements is false about BY-group processing?
When you use the BY statement with the SET statement,
a.     the data sets that are listed in the SET statement must be indexed or sorted by the values of the BY variable(s).
b.    the DATA step automatically creates two variables, FIRST. and LAST., for each variable in the BY statement.
c.     FIRST. and LAST. identify the first and last observation in each BY group, in that order.
d.    FIRST. and LAST. are stored in the data set.
There are 500 observations in the data set Company.USA. What is the result of submitting the following program?
data work.getobs5(drop=obsnum);
   obsnum=5;
   set company.usa(keep=manager payroll) point=obsnum;
   stop;
run;
a.     an error
b.    an empty data set
c.     a continuous loop
d.    a data set that contains one observation
There is no end-of-file condition when you use direct access to read data, so how can your program prevent a continuous loop?
a.     Do not use a POINT= variable.
b.    Check for an invalid value of the POINT= variable.
c.     Do not use an END= variable.
d.    Include an OUTPUT statement.
Assuming that the data set Company.USA has five or more observations, what is the result of submitting the following program?
data work.getobs5(drop=obsnum);
   obsnum=5;
   set company.usa(keep=manager payroll) point=obsnum;
   output;
   stop;
run;
a.     an error
b.    an empty data set
c.     a continuous loop
d.    a data set that contains one observation
Which of the following statements is true regarding direct access of data sets?
a.     You cannot specify END= with POINT=.
b.    You cannot specify OUTPUT with POINT=.
c.     You cannot specify STOP with END=.
d.    You cannot specify FIRST. with LAST.
What is the result of submitting the following program?
data work.addtoend;
   set clinic.stress2 end=last;
   if last;
run;
a.     an error
b.    an empty data set
c.     a continuous loop
d.    a data set that contains one observation
At the start of DATA step processing, during the compilation phase, variables are created in the program data vector (PDV), and observations are set to
a.     blank
b.    missing
c.     0
d.    there are no observations.
The DATA step executes
a.     continuously if you use the POINT= option and the STOP statement.
b.    once for each variable in the output data set.
c.     once for each observation in the input data set.
d.    until it encounters an OUTPUT statement.
Which program will combine Brothers.One and Brothers.Two to produce Brothers.Three?
Image from book
a.     data brothers.three;
b.        set brothers.one;
c.         set brothers.two;
d.    run;
e.     data brothers.three;
f.          set brothers.one brothers.two;
g.    run;
h.    data brothers.three;
i.          set brothers.one brothers.two;
j.          by varx;
k.     run;
l.      data brothers.three;
m.       merge brothers.one brothers.two;
n.       by varx;
o.    run;
Which program will combine Actors.Props1 and Actors.Props2 to produce Actors.Props3?
Image from book
a.     data actors.props3;
b.        set actors.props1;
c.         set actors.props2;
d.    run;
e.     data actors.props3;
f.          set actors.props1 actors.props2;
g.    run;
h.    data actors.props3;
i.          set actors.props1 actors.props2;
j.          by actor;
k.     run;
l.      data actors.props3;
m.       merge actors.props1 actors.props2;
n.       by actor;
o.    run;
If you submit the following program, which new data set is created?
Image from book
data work.jobsatis;
   set work.dataone work.datatwo;
run;
a.       
Career
Supervis
Finance
Variety
Feedback
Autonomy
72
26
9
.
.
.
63
76
7
.
.
.
96
31
7
.
.
.
96
98
6
.
.
.
84
94
6
.
.
.
.
.
.
10
11
70
.
.
.
85
22
93
.
.
.
83
63
73
.
.
.
82
75
97
.
.
.
36
77
97
b.      
Career
Supervis
Finance
Variety
Feedback
Autonomy
72
26
9
10
11
70
63
76
7
85
22
93
96
31
7
83
63
73
96
98
6
82
75
97
84
94
6
36
77
97
c.       
Career
Supervis
Finance
72
26
9
63
76
7
96
31
7
96
98
6
84
94
6
10
11
70
85
22
93
83
63
73
82
75
97
36
77
97
d.    none of the above
If you concatenate the data sets below in the order shown, what is the value of Sale in observation 2 of the new data set?
Image from book
a.     missing
b.    $30,000
c.     $40,000
d.    you cannot concatenate these data sets
What happens if you merge the following data sets by variable SSN?
Image from book
a.     The values of Age in the 1st data set overwrite the values of Age in the 2nd data set.
b.    The values of Age in the 2nd data set overwrite the values of Age in the 1st data set.
c.     The DATA step fails because the two data sets contain same-named variables that have different values.
d.    The values of Age in the 2nd data set are set to missing.
Suppose you merge data sets Health.Set1 and Health.Set2 below:
Image from book
Which output does the following program create?
data work.merged;
   merge health.set1(in=in1) health.set2(in=in2);
   by id;
   if in1 and in2;
run;
proc print data=work.merged;
run;
a.       
Obs
ID
Sex
Age
Height
Weight
1
1129
F
48
61
137
2
1274
F
50
.
.
3
1387
F
57
64
142
4
2304
F
16
61
102
5
2486
F
63
.
.
6
4425
F
48
.
.
7
4759
F
60
.
.
8
5438
F
42
62
168
9
6488
F
59
64
154
10
9012
F
39
63
157
11
9125
F
56
64
159
b.      
Obs
ID
Sex
Age
Height
Weight
1
1129
F
48
61
137
2
1387
F
50
64
142
3
2304
F
57
61
102
4
5438
F
16
62
168
5
6488
F
63
64
154
6
9012
F
48
63
157
7
9125
F
60
64
159
8
5438
F
42
.
.
9
6488
F
59
.
.
10
9012
F
39
.
.
11
9125
F
56
.
.
c.       
Obs
ID
Sex
Age
Height
Weight
1
1129
F
48
61
137
2
1387
F
57
64
142
3
2304
F
16
61
102
4
5438
F
42
62
168
5
6488
F
59
64
154
6
9012
F
39
63
157
7
9125
F
56
64
159
d.    none of the above
The data sets Ensemble.Spring and Ensemble.Summer both contain a variable named Blue. How do you prevent the values of the variable Blue from being overwritten when you merge the two data sets?
a.      data ensemble.merged;
b.        merge ensemble.spring(in=blue)
c.               ensemble.summer;
d.        by fabric;
e.     run;
f.      data ensemble.merged;
g.        merge ensemble.spring(out=blue)
h.              ensemble.summer;
i.          by fabric;
j.      run;
k.     data ensemble.merged;
l.          merge ensemble.spring(blue=navy)
m.             ensemble.summer;
n.        by fabric;
o.    run;
p.    data ensemble.merged;
q.        merge ensemble.spring(rename=(blue=navy))
r.              ensemble.summer;
s.         by fabric;
t.      run;
What happens if you submit the following program to merge Blood.Donors1 and Blood.Donors2, shown below?
data work.merged;
   merge blood.donors1 blood.donors2;
   by id;
run;
Image from book
a.     The Merged data set contains some missing values because not all observations have matching observations in the other data set.
b.    The Merged data set contains 8 observations.
c.     The DATA step produces errors.
d.    Values for Units in Blood.Donors2 overwrite values for Units in Blood.Donors1.
If you merge Company.Staff1 and Company.Staff2 below by ID, how many observations does the new data set contain?
Image from book
a.     4
b.    5
c.     6
d.    9
If you merge data sets Sales.Reps, Sales.Close, and Sales.Bonus by ID, what is the value of Bonus in the third observation in the new data set?
Image from book
a.     $4,000
b.    $3,000
c.     missing
d.    can't tell from the information given
Which function calculates the average of the variables Var1, Var2, Var3, and Var4?
a.     mean(var1,var4)
b.    mean(var1-var4)
c.     mean(of var1,var4)
d.    mean(of var1-var4)
Within the data set Hrd.Temp, PayRate is a character variable and Hours is a numeric variable. What happens when the following program is run?
data work.temp;
   set hrd.temp;
   Salary=payrate*hours;
run;
a.     SAS converts the values of PayRate to numeric values. No message is written to the log.
b.    SAS converts the values of PayRate to numeric values. A message is written to the log.
c.     SAS converts the values of Hours to character values. No message is written to the log.
d.    SAS converts the values of Hours to character values. A message is written to the log.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.