Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which of the following
statements associates the fileref OnSale with the raw data files London.dat,
Paris.dat, and Zurich.dat? The files are stored in the C:RoutesNew
directory in the Windows operating environment.
-
filename onsale (c:
outes
ewlondon.dat,
c:
outes
ewparis.dat,
c:
outes
ewzurich.dat);
-
filename onsale 'c:
outes
ewlondon.dat'
'c:
outes
ewparis.dat'
'c:
outes
ewzurich.dat';
-
filename onsale ('c:
outes
ewlondon.dat'
'c:
outes
ewparis.dat'
'c:
outes
ewzurich.dat'),
-
filename onsale 'c:
outes
ewlondon.dat
c:
outes
ewparis.dat
c:
outes
ewzurich.dat';
-
Which of the following
statements is true?
-
The FILEVAR= option
can be used to dynamically change the currently opened input file
to a new physical file.
-
The FILEVAR= variable
is not written to the data set.
-
The FILEVAR= variable
must contain a character string that is a physical filename.
-
-
Given the following
program, which table correctly shows the corresponding values of the
variables Month and Readfile?
data work.revenue;
do month = 8, 9, 10;
readfile=compress("c:datamonth"
!!put(month,2.)!!".dat");
do until (lastobs);
infile temp filevar=readfile
end=lastobs;
input Date : date7. Location $
Sales : dollar10.;
output;
end;
end;
stop;
run;
-
When x=
|
readfile=
|
8
|
month8.dat
|
9
|
month9.dat
|
10
|
month10.dat
|
-
When x=
|
readfile=
|
8
|
c:datamonth8.dat
|
9
|
c:datamonth9.dat
|
10
|
c:datamonth10.dat
|
-
When x=
|
readfile=
|
8
|
c:datamonth 8.dat
|
9
|
c:datamonth 9.dat
|
10
|
c:datamonth10.dat
|
-
When x=
|
readfile=
|
8
|
month8
|
9
|
month9
|
10
|
month10
|
-
If the current date
is March 30, 2003, which table correctly shows the corresponding values
of the variables y1, y2, y3, and Nextfile?
data work.quarter (drop=monthnum midmon lastmon);
y3=year(today());
y2=y3-1;
y1=y3-2;
do i = y3, y2, y1;
nextfile="c:dataY"!!put(i,4.)!!".dat";
do until (lastobs);
infile temp filevar=nextfile
end=lastobs;
input Flight $ Origin $ Dest $
Date : date9.;
output;
end;
end;
stop;
run;
-
When i=
|
Nextfile=
|
y1
|
c:dataY2001.dat
|
y2
|
c:dataY2002.dat
|
y3
|
c:dataY2003.dat
|
-
When i=
|
Nextfile=
|
y1
|
Y2001.dat
|
y2
|
Y2002.dat
|
y3
|
Y2003.dat
|
-
When i=
|
Nextfile=
|
y1
|
c:dataY2003.dat
|
y2
|
c:dataY2002.dat
|
y3
|
c:dataY2001.dat
|
-
When i=
|
Nextfile=
|
y1
|
c:dataY3.dat
|
y2
|
c:dataY2.dat
|
y3
|
c:dataY1.dat
|
-
What happens when SAS
processes the last data record in an input file?
-
The END= variable is
set to
1.
-
The END= variable is
set to
0.
-
The END= variable is
set to the number of records in the input file.
-
The END= variable is
written to the SAS data set.
-
Which program appends
Work.London to Work.Flights?
-
proc append base=work.london
data=work.flights;
run;
-
proc append data=work.london
base=work.flights;
run;
-
proc append data=work.london work.flights;
run;
-
proc append data=work.flights work.london;
run;
-
What happens when the
following program is submitted?
proc append base=staff.marketing
data=staff.sales force;
run;
Data Set Description
for Staff.Marketing
|
Data Set Description
for Staff.Sales
|
|
|
-
The length of LastName
is converted to 20 in Staff.Marketing.
-
LastName is dropped
from Staff.Marketing.
-
Missing values are assigned
to LastName observations that are read in from Staff.Sales.
-
Some of the values of
LastName might be truncated in the observations that are read in from
Staff.Sales.
-
Which program appends
Work.April to Work.Y2003?
Data Set Description
for Work.Y2003
|
Data Set Description
for Work.April
|
|
|
-
proc append base=work.y2003
data=work.april;
run;
-
proc append base=work.april
data=work.y2003 force;
run;
-
proc append base=work.y2003
data=work.april force;
run;
-
proc append base=work.april
data=work.y2003;
run;
-
What happens when the
SAS data set Work.NewHires is appended to the SAS data set Work.Employees
using PROC APPEND?
Data Set Description
for Work.Employees
|
Data Set Description
for Work.NewHires
|
|
|
-
Missing values are assigned
to Room for the observations that are read in from Work.NewHires.
-
Missing values are assigned
to Room for all of the observations in Work.Employees.
-
Room is dropped from
Work.Employees.
-
The values of Name are
truncated in the observations that are read in from Work.NewHires.
-
You do not need to use
the FORCE option with PROC APPEND when the following is true:
-
the DATA= data set contains
variables that are not in the BASE= data set.
-
the BASE= data set contains
variables that are not in the DATA= data set.
-
the variables in the
DATA= data set are longer than the corresponding variables in the
BASE= data set.
-
the variables in the
DATA= data set have a different type than the corresponding variables
in the BASE= data set.