SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Quiz: Reading Raw Data in Fixed Fields

Select the best answer for each question and click Score My Quiz.

  1. Which SAS statement correctly uses column input to read the values in the raw data file below in this order: Address (4th field), SquareFeet (2nd field), Style (1st Field), Bedrooms (3rd field) ?

    1---+----10---+----20---+----30
    2STORY 1810 4 SHEPPARD AVENUE
    CONDO  1200 2 RAND STREET
    RANCH  1550 3 MARKET STREET

     a.  
    input Address 15-29 SquareFeet 8-11 Style 1-6
          Bedrooms 13;
     
     b.  
    input $ 15-29 Address 8-11 SquareFeet $ 1-6 Style
          13 Bedrooms;                   
     
     c.  
    input Address $ 15-29 SquareFeet 8-11 Style $ 1-6
          Bedrooms 13;
     
     d.  
    input Address 15-29 $ SquareFeet 8-11 Style 1-6
          $ Bedrooms 13;  

  2. Which is not an advantage of column input?

     a.   Character variables can be up to 200 characters in length and contain embedded blanks.
     b.   No placeholder is required for missing data.
     c.   Standard as well as nonstandard data values can be read.
     d.   Fields do not have to be separated by blanks or other delimiters.

  3. Which is an example of standard numeric data?

     a.   -34.245
     b.   $24,234.25
     c.   1/2
     d.   50%

  4. Formatted input can be used to read

     a.   standard free-format data
     b.   standard data in fixed fields
     c.   nonstandard data in fixed fields
     d.   both standard and nonstandard data in fixed fields

  5. Which informat should you use to read the values in column 1?

    1---+----10---+----20---+----30
    DG345 CD PLAYER   $174.99
    HJ756 VCR         $298.99
    AS658 CAMCORDER $1,195.99

     a.   w.
     b.   $w.
     c.   w.d
     d.   COMMAw.d

  6. The COMMAw.d informat can be used to read which of the following values?

     a.   12,805
     b.   $177.95
     c.   18 %
     d.   all of the above

  7. Which INPUT statement correctly reads the values for ModelNumber (1st field) after the values for Item (2nd field)? Both Item and ModelNumber are character variables.

    1---+----10---+----20---+----30
    DG345 CD PLAYER   $174.99
    HJ756 VCR         $298.99
    AS658 CAMCORDER $1,195.99

     a.  
    input $9. @1 ModelNumber $5.; 
     b.  
    input +6 Item $9. @1 ModelNumber $5.;  
     c.  
    input @7 Item $9. +1 ModelNumber $5.; 
     d.  
    input @7 Item $9 @1 ModelNumber 5.; 

  8. Which INPUT statement correctly reads the numeric values for Cost (3rd field)?

    1---+----10---+----20---+----30
    DG345 CD PLAYER   $174.99
    HJ756 VCR         $298.99
    AS658 CAMCORDER $1,195.99

     a.  
    input @17 Cost 7.2; 
     b.  
    input @17 Cost 9.2.; 
     c.  
    input @17 Cost comma7.; 
     d.  
    input @17 Cost comma9.; 

  9. Which SAS statement correctly uses formatted input to read the values in this order: Item (1st field), UnitCost (2nd field), Quantity (3rd field)?

    1---+----10---+----20---+
    ENVELOPE  $13.25 500
    DISKETTES $29.50  10
    BANDS     $2.50  600
    RIBBON    $94.20  12

     a.  
    input @1 Item $9. +1 UnitCost comma6.
          @18 Quantity 3.;
     
     b.  
    input Item $9. @11 UnitCost comma6.
          @18 Quantity 3.;                    
     
     c.  
    input Item $9. +1 UnitCost comma6.
          @18 Quantity 3.;
     
     d.   all of the above

  10. Which raw data file requires the PAD option in the INFILE statement to correctly read the data using column or formatted input?

     a.  
    1---+----10---+----20---+
    JONES    M 48 128.6
    LAVERNE  M 58 158
    JAFFE    F 33 115.5
    WILSON   M 28 130  


     b.  
    1---+----10---+----20---+
    JONES    M 48 128.6
    LAVERNE  M 58 158.0
    JAFFE    F 33 115.5
    WILSON   M 28 130.0  


     c.  
    1---+----10---+----20---+
    JONES    M 48 128.6
    LAVERNE  M 58   158
    JAFFE    F 33 115.5
    WILSON   M 28   130  


     d.  
    1---+----10---+----20---+
      JONES    M 48 128.6
    LAVERNE    M 58 158.0
      JAFFE    F 33 115.5
     WILSON    M 28 130.0  




back||next

Terms of Use & Legal Information | Privacy Statement