SAS Chapter 14: Combining Data Vertically

10 Questions | Total Attempts: 56

SettingsSettingsSettings
SAS Chapter 14: Combining Data Vertically

Practice for the SAS advance certification exam.


Questions and Answers
  • 1. 
    Which of the following statements associates the fileref OnSale with the raw data files London.dat, Paris.dat, and Zurich.dat? The files are stored in the C:\Routes\New directory in the Windows operating environment.
    • A. 

      filename onsale (c:\routes\new\london.dat, c:\routes\new\paris.dat, c:\routes\new\zurich.dat);

    • B. 

      filename onsale 'c:\routes\new\london.dat' 'c:\routes\new\paris.dat' 'c:\routes\new\zurich.dat';

    • C. 

      filename onsale ('c:\routes\new\london.dat' 'c:\routes\new\paris.dat' 'c:\routes\new\zurich.dat');

    • D. 

      filename onsale 'c:\routes\new\london.dat c:\routes\new\paris.dat c:\routes\new\zurich.dat';

  • 2. 
    Which of the following statements is true?
    • A. 

      The FILEVAR= option can be used to dynamically change the currently opened input file to a new physical file.

    • B. 

      The FILEVAR= variable is not written to the data set.

    • C. 

      The FILEVAR= variable must contain a character string that is a physical filename.

    • D. 

      All of the above

  • 3. 
    Given the following program, which table correctly shows the corresponding values of the variables x and readfile? data work.revenue; do x = 8, 9, 10; readfile=compress("c:\data\month" !!put(x,2.)!!".dat",' '); do until (lastobs); infile temp filevar=nextfile end=lastobs; input Date : date7. Location $ Sales : dollar10.2; output; end; end; stop; run;
    • A. 
    • B. 
    • C. 
    • D. 
  • 4. 
    If the current date is March 30, 2003, which table correctly shows the corresponding values of the variables y1, y2, y3, and nextfile? data work.quarter (drop=monthnum midmon lastmon); y3=year(today()); y2=y3-1; y1=y3-2; do i = y3, y2, y1; nextfile="c:\data\Y"!!put(i,4.)!!".dat"; do until (lastobs); infile temp filevar=nextfile end=lastobs; input Flight $ Origin $ Dest $ Date : date9.; output; end; end; stop; run;  
    • A. 
    • B. 
    • C. 
    • D. 
  • 5. 
    Which of the following statements is false?
    • A. 

      The END= variable is set to 0 when SAS processes the last data record in the input file.

    • B. 

      The END= variable is set to 1 when SAS processes the last data record in the input file.

    • C. 

      The END= variable is not written to the data set.

    • D. 

      A and c

  • 6. 
    Which program appends Work.London to Work.Flights?
    • A. 

      proc append base=work.london data=work.flights; run;

    • B. 

      proc append data=work.london base=work.flights; run;

    • C. 

      proc append data=work.london work.flights; run;

    • D. 

      proc append data=work.flights work.london; run;

  • 7. 
    What happens when the following program is submitted? proc append base=staff.marketing data=staff.sales force; run;
    • A. 

      The length of LastName is converted to 20 in Staff.Marketing.

    • B. 

      LastName is dropped from Staff.Marketing.

    • C. 

      Missing values are assigned to LastName observations that are read in from Staff.Sales.

    • D. 

      Some of the values of LastName may be truncated in the observations that are read in from Staff.Sales.

  • 8. 
    Which program appends Work.April to Work.Y2003?
    • A. 

      proc append base=work.y2003 data=work.april; run;

    • B. 

      proc append base=work.april data=work.y2003 force; run;

    • C. 

      proc append base=work.y2003 data=work.april force; run;

    • D. 

      proc append base=work.april data=work.y2003; run;

  • 9. 
    What happens when the SAS data set Work.NewHires is appended to the SAS data set Work.Employees using PROC APPEND?
    • A. 

      Missing values are assigned to Room for the observations that are read in from Work.NewHires.

    • B. 

      Missing values are assigned to Room for all of the observations in Work.Employees.

    • C. 

      Room is dropped from Work.Employees.

    • D. 

      The values of Name are truncated in the observations that are read in from Work.NewHires.

  • 10. 
    You do not need to use the FORCE option with PROC APPEND when
    • A. 

      The DATA= data set contains variables that are not in the BASE= data set.

    • B. 

      The BASE= data set contains variables that are not in the DATA= data set.

    • C. 

      The variables in the DATA= data set are longer than the corresponding variables in the BASE= data set

    • D. 

      The variables in the DATA= data set have a different type than the corresponding variables in the BASE= data set.

Related Topics
Back to Top Back to top