You assign a fileref
by using a FILENAME statement in the same way that you assign a libref
by using a LIBNAME statement.
Correct answer: b
By default, the IMPORT
procedure reads delimited files as varying record-length files. If
your external file has a fixed-length format, use the OPTIONS statement
before the PROC IMPORT statement that includes the RECFM=F and LRECL=
options.
Correct answer: a
Use the OBS= option
in the OPTIONS statement before the IMPORT procedure to limit the
number of observations that SAS reads from the external file. When
you use the OBS= option in the PROC PRINT statement, the whole file
is imported but printing is limited to the number of observations
specified. Use DELIMITER='.' to indicate that the delimiter
is a period (.) and use GETNAMES=YES to read in the first line, which
contains the variable names.
Correct answer: d
To read an Excel workbook
file, SAS must receive the following information in the DATA step:
a libref to reference the Excel workbook to be read, the name and
location (using another libref) of the new SAS data set, and the name
of the Excel worksheet that is to be read.
Correct answer: d
The GETNAMES statement
specifies whether the IMPORT procedure generates SAS variable names
from the data values in the first row in the input file. The default
is GETNAMES=YES. NO specifies that the IMPORT procedure generates
SAS variable names as VAR1, VAR2, and so on.
Correct answer: b
When you associate a
fileref with an individual external file, you specify the fileref
in subsequent SAS statements and commands.
Correct answer: d
The IMPORT procedure
reads data from an external data source and writes it to a SAS data
set. In delimited files, a delimiter (such as a blank, comma, or tab)
separates columns of data values. You can also have a delimiter other
than blanks, commas, or tabs. In those cases, PROC IMPORT reads the
data from the external data source as well. You can have a delimiter
such as an ampersand (&).
Correct answer: b
Placing an explicit
OUTPUT statement in a DATA step overrides the automatic output, so
that observations are added to a data set only when the explicit OUTPUT
statement is executed. The OUTPUT statement overrides the default
behavior of the DATA step.