Importing Data Using SAS - 1

25 Questions | Total Attempts: 112

SettingsSettingsSettings
SAS Quizzes & Trivia

Questions and Answers
  • 1. 
    A raw data file is listed below.  1---+----10---+----20---+---        ran andhy 01/31/89 andriya carlos 12-25-87 samson antony 01/17/51 The following program is submitted using above file as input: data work.family; infile 'file-specification'; run;
    • A. 

      Input lastname $ first_name $ birthdate date9.;

    • B. 

      Input lastname $ first_name $ birthdate : mmddyy8.;

    • C. 

      Input lastname $ first_name $ birthdate mmddyy8.;

    • D. 

      Input lastname $ first_name $ birthdate : date9.;

  • 2. 
    Data scores; infile datalines; input Name $ scr1 scr2 scr3 scr4 scr5 scr6; datalines; steven 30 40 60 80 sabastian 40 30 25 45 71 85 robert 20 60 10 ; run;   Desired output Name         scr1 scr2 scr3 scr4 scr5 scr6 Steven       30     40     60   80     .       .      Sabastian  40     30     25   45    75  85 Robert       20     60     10   What option we need to use in order to get desired outcome
    • A. 

      MISSOVER

    • B. 

      DSD

    • C. 

      TRUNCOVER

    • D. 

      FLOWOVER

  • 3. 
    The following is an example of.... (Choose one) data employee; infile 'employee.dat'; /* Assuming directory-based system */ input id $6. name $20. @30 locale $10.; run;
    • A. 

      List

    • B. 

      Column

    • C. 

      Formatted

    • D. 

      Mixed

  • 4. 
    filename statement can be used to access external file
    • A. 

      True

    • B. 

      False

  • 5. 
    Default delimiter for list input is
  • 6. 
    Using dsd option in infile statement changes default delimiter to comma
    • A. 

      True

    • B. 

      False

  • 7. 
    Following delimiter will be used to access ASCII files
    • A. 

      Dlm='09'x

    • B. 

      Dlm='05'x

    • C. 

      Dlm=':'

    • D. 

      Dlm='|'

  • 8. 
    Following statement will be used to place data directly into sas program
    • A. 

      Datafileds

    • B. 

      Datalines

    • C. 

      Datavars

    • D. 

      Datainput

  • 9. 
    Which input method is more appropriate to import data with following description Variable    Description         Starting  Ending      DataType                                             Column  Column Subj           Subject Number     1             3          Character DOB           Date of Birth          4           13          Character Gender       Gender                14           14          Character Balance      Bank Account      15            21         Numeric                     Balance          
    • A. 

      Column

    • B. 

      Formatted

  • 10. 
    In following code is example of data grade; infile 'c:\grading.txt'; input student_id $ 1-3 DOB $ 4-13 Gender $ 14 Score 15-21; run;
    • A. 

      List input

    • B. 

      Formatted input

    • C. 

      Column input

    • D. 

      Fixed input

  • 11. 
    For numeric variables SAS uses _____ bytes to store values
  • 12. 
    Informat is required to import date and time values into SAS
    • A. 

      True

    • B. 

      False

  • 13. 
    SAS stores dates into numaric values
    • A. 

      True

    • B. 

      False

  • 14. 
    SAS uses following date for date calculations
    • A. 

      January 1, 1960

    • B. 

      January 1, 1961

    • C. 

      June 1, 1960

    • D. 

      June 1, 1961

  • 15. 
    SAS date value for December 1, 1959
    • A. 

      -31

    • B. 

      0

    • C. 

      21

    • D. 

      31

  • 16. 
    Following are example of standard numeric data (select all correct choices)
    • A. 

      -1.54E-3

    • B. 

      1.54E3

    • C. 

      0.5

    • D. 

      10

    • E. 

      -10

    • F. 

      $10,000

  • 17. 
    Following are informat modifers in sas (select all correct choices)
    • A. 

      :

    • B. 

      $

    • C. 

      #

    • D. 

      &

  • 18. 
    A SAS time value is stored as the number of seconds since midnight
    • A. 

      True

    • B. 

      False

  • 19. 
    Following are true for YEARCUTOFF option in SAS (select all correct choices)
    • A. 

      Not applicable to four digit year values

    • B. 

      This is system option

    • C. 

      Default is 1920

  • 20. 
    If default YEARCUTOFF is used while importing 07/04/1776 using mmddyy8. informat. SAS interprets the date as
    • A. 

      1976

    • B. 

      2076

    • C. 

      1917

    • D. 

      2017

  • 21. 
    Which of the following represents permanent sas library reference
    • A. 

      Temp.data1

    • B. 

      Work.data1

    • C. 

      Train.data1

    • D. 

      Location.data1

  • 22. 
    Files stored in temporary library will be deleted at the end of the sas session
    • A. 

      True

    • B. 

      False

  • 23. 
    Following sas statement is used to retain values across iterations
    • A. 

      Keep

    • B. 

      Store

    • C. 

      Retain

    • D. 

      Length

  • 24. 
    Following can be used to hold a record across multiple iterations of the DATA step
    • A. 

      @

    • B. 

      @@

    • C. 

      #

    • D. 

      ##

Related Topics
Back to Top Back to top