Chapter 4: Creating SAS Data Sets

  1. Correct answer: a
    You assign a fileref by using a FILENAME statement in the same way that you assign a libref by using a LIBNAME statement.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Correct answer: b
    When you associate a fileref with an individual external file, you specify the fileref in subsequent SAS statements and commands.
  7. Correct answer: c
    The SAS/ACCESS LIBNAME statement associates a SAS name with a Microsoft Excel workbook file by pointing to its location. In doing so, the Excel workbook becomes a new library in SAS, and the worksheets in the workbook become the individual SAS data sets in that library.
  8. 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 (&).
  9. 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.
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.233.43