Chapter 17: Reading Raw Data in Fixed Fields

  1. Correct answer: c
    Column input specifies the variable's name, followed by a dollar ($) sign if the values are character values, and the beginning and ending column locations of the raw data values.
  2. Correct answer: c
    Column input is useful for reading standard values only.
  3. Correct answer: a
    A standard numeric value can contain numbers, scientific notation, decimal points, and plus and minus signs. Nonstandard numeric data includes values that contain fractions or special characters such as commas, dollar signs, and percent signs.
  4. Correct answer: d
    Formatted input can be used to read both standard and nonstandard data in fixed fields.
  5. Correct answer: b
    The $w. informat enables you to read character data. The w represents the field width of the data value or the total number of columns that contain the raw data field.
  6. Correct answer: d
    The COMMAw.d informat strips out special characters, such as commas, dollar signs, and percent signs, from numeric data and stores only numeric values in a SAS data set.
  7. Correct answer: b
    The +6 pointer control moves the input pointer to the beginning column of Item, and the values are read. Then the @1 pointer control returns to column 1, where the values for ModelNumber are located.
  8. Correct answer: d
    The values for Cost contain dollar signs and commas, so you must use the COMMAw.d informat. Counting the numbers, dollar sign, comma, and decimal point, the field width is 9 columns. Because the data value contains decimal places, a d value is not needed.
  9. Correct answer: d
    The default location of the column pointer control is column 1, so a column pointer control is optional for reading the first field. You can use the @n or +n pointer controls to specify the beginning column of the other fields. You can use the $w. informat to read the values for Item, the COMMAw.d informat for UnitCost, and the w.d informat for Quantity.
  10. Correct answer: a
    Use the PAD option in the INFILE statement to read variable-length records that contain fixed-field data. The PAD option pads each record with blanks so that all data lines have the same length.
Last updated: January 10, 2018
..................Content has been hidden....................

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