Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. Which SAS statement associates the fileref Crime with the raw data file C:StatesDatacrime.dat?
    1. filename crime 'c:statesdatacrime.dat';
    2. filename crime c:statesdatacrime.dat;
    3. fileref crime 'c:statesdatacrime.dat';
    4. filename 'c:statesdatacrime' crime.dat;
  2. Which type of delimited file does PROC IMPORT read by default?
    1. logical record-length files
    2. varying record-length files
    3. fixed record-length files
    4. illogical record-length files
  3. Which program correctly imports only the first seven lines from the external file that is delimited by a period (.) ? Hint: the first line in the external file contains variable names that you want to read in.
    1. options obs=7;
      proc import data="C:users	est.txt"
        out=exam
        dbms=dlm
        replace;
        getnames=yes;
      run;
      proc print data=exam;
      run;
    2. options obs=7;
      proc import datafile="c:users	est.txt"
        out=exam
        dbms=dlm
        replace;
        delimiter='.';
        getnames=yes;
      run;
      proc print data=exam;
      run;
      
    3. proc import datafile="c:users	est.txt"
        out=exam
        dbms=dlm
        replace;
        delimiter=' ';
        getnames=no;
      run;
      proc print data=exam (obs=7);
      run;
      
    4. proc import datafile="c:users	est.txt"
        out=exam
        dbms=csv
        replace;
        delimiter=',';
        getnames=no;
      run;
      proc print data=exam;
        options obs=7;
      run;
      
  4. Which of the following pieces of information does SAS need in the DATA step in order to read an Excel workbook file and write it out to a SAS data set?
    1. a libref to reference the Excel workbook to be read
    2. the name and location (using another libref) of the new SAS data set
    3. the name of the Excel worksheet that is to be read
    4. all of the above
  5. Which statement should you use if you want PROC IMPORT to generate SAS variable names from the values in the first row of an input file?
    1. getnames=no;
    2. datarow=1;
    3. guessingrows=1;
    4. getnames=yes;
  6. Which SAS program correctly imports data from an external file?
    1. filename workbook 'C:certdataclass1.csv';
      proc import datafile=workbook.class
        dbms=csv
        out=class1
        replace;
        getnames=yes;
      run;
    2. filename workbook 'C:certdataworkbook.txt';
      proc import datafile=workbook
        dbms=dlm
        out=workbook
        replace;
        getnames=yes;
      run;
      
    3. filename workbook 'C:certdataworkbook.txt';
      proc import datafile=class01
        dbms=dlm
        out=class01work
        replace;
        getnames=yes;
      run;
    4. all of the above.
  7. Which delimited input file can be imported using PROC IMPORT?
    1. Region&State&Month&Expenses&Revenue                                             
      Southern&GA&JAN2001&2000&8000                                                   
      Southern&GA&FEB2001&1200&6000                                                   
      Southern&FL&FEB2001&8500&11000                                                  
      Northern&NY&FEB2001&3000&4000                                                   
      Northern&NY&MAR2001&6000&5000                                                   
      Southern&FL&MAR2001&9800&13500                                                  
      Northern&MA&MAR2001&1500&1000                                                   
      
    2. "Africa","Boot","Addis Ababa","12","$29,761","$191,821","$769"
      "Asia","Boot","Bangkok","1","$1,996","$9,576","$80"
      "Canada","Boot","Calgary","8","$17,720","$63,280","$472"
      "Eastern Europe","Boot","Budapest","22","$74,102","$317,515","$3,341"
      "Middle East","Boot","Al-Khobar","10","$15,062","$44,658","$765"
      "Pacific","Boot","Auckland","12","$20,141","$97,919","$962"
      "South America","Boot","Bogota","19","$15,312","$35,805","$1,229"
      "United States","Boot","Chicago","16","$82,483","$305,061","$3,735"
      "Western Europe","Boot","Copenhagen","2","$1,663","$4,657","$129"
    3. Region State Capital Bird
      South Georgia Atlanta 'Brown Thrasher'
      South 'North Carolina' Raleigh Cardinal
      North Connecticut Hartford Robin
      West Washington Olympia 'American Goldfinch'
      Midwest Illinois Springfield Cardinal
    4. all of the above
  8. To override the DATA step default behavior that writes observations to output, what should you use in a DATA step?
    1. DROP= and KEEP= data set options
    2. an OUTPUT statement
    3. an OUT= option
    4. a BY statement
Last updated: February 14, 2019
..................Content has been hidden....................

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