Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  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:RoutesNew directory in the Windows operating environment.
    1. filename onsale (c:
      outes
      ewlondon.dat,
         c:
      outes
      ewparis.dat, 
         c:
      outes
      ewzurich.dat);
    2. filename onsale 'c:
      outes
      ewlondon.dat'
         'c:
      outes
      ewparis.dat'
         'c:
      outes
      ewzurich.dat';
    3. filename onsale ('c:
      outes
      ewlondon.dat'
         'c:
      outes
      ewparis.dat' 
         'c:
      outes
      ewzurich.dat'),
    4. filename onsale 'c:
      outes
      ewlondon.dat
         c:
      outes
      ewparis.dat
         c:
      outes
      ewzurich.dat';
  2. Which of the following statements is true?
    1. The FILEVAR= option can be used to dynamically change the currently opened input file to a new physical file.
    2. The FILEVAR= variable is not written to the data set.
    3. The FILEVAR= variable must contain a character string that is a physical filename.
    4. all of the above
  3. Given the following program, which table correctly shows the corresponding values of the variables Month and Readfile?
    data work.revenue; 
       do month = 8, 9, 10; 
          readfile=compress("c:datamonth"
            !!put(month,2.)!!".dat");
          do until (lastobs); 
             infile temp filevar=readfile
               end=lastobs;
             input Date : date7. Location $ 
                   Sales : dollar10.;
             output;
          end;
       end;
       stop;
    run;
    1. When x=
      readfile=
      8
      month8.dat
      9
      month9.dat
      10
      month10.dat
    2. When x=
      readfile=
      8
      c:datamonth8.dat
      9
      c:datamonth9.dat
      10
      c:datamonth10.dat
    3. When x=
      readfile=
      8
      c:datamonth 8.dat
      9
      c:datamonth 9.dat
      10
      c:datamonth10.dat
    4. When x=
      readfile=
      8
      month8
      9
      month9
      10
      month10
  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:dataY"!!put(i,4.)!!".dat";        
          do until (lastobs); 
             infile temp filevar=nextfile 
               end=lastobs; 
             input Flight $ Origin $ Dest $ 
                   Date : date9.;
             output;
          end;
       end;
       stop;
    run;
    1. When i=
      Nextfile=
      y1
      c:dataY2001.dat
      y2
      c:dataY2002.dat
      y3
      c:dataY2003.dat
    2. When i=
      Nextfile=
      y1
      Y2001.dat
      y2
      Y2002.dat
      y3
      Y2003.dat
    3. When i=
      Nextfile=
      y1
      c:dataY2003.dat
      y2
      c:dataY2002.dat
      y3
      c:dataY2001.dat
    4. When i=
      Nextfile=
      y1
      c:dataY3.dat
      y2
      c:dataY2.dat
      y3
      c:dataY1.dat
  5. What happens when SAS processes the last data record in an input file?
    1. The END= variable is set to 1.
    2. The END= variable is set to 0.
    3. The END= variable is set to the number of records in the input file.
    4. The END= variable is written to the SAS data set.
  6. Which program appends Work.London to Work.Flights?
    1. proc append base=work.london 
                  data=work.flights;
      run;
    2. proc append data=work.london 
                  base=work.flights;
      run;
    3. proc append data=work.london work.flights;
      run;
    4. 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;
    Data Set Description for Staff.Marketing
    Data Set Description for Staff.Sales
    1. The length of LastName is converted to 20 in Staff.Marketing.
    2. LastName is dropped from Staff.Marketing.
    3. Missing values are assigned to LastName observations that are read in from Staff.Sales.
    4. Some of the values of LastName might be truncated in the observations that are read in from Staff.Sales.
  8. Which program appends Work.April to Work.Y2003?
    Data Set Description for Work.Y2003
    Data Set Description for Work.April
    1. proc append base=work.y2003 
                  data=work.april;
      run;
    2. proc append base=work.april 
                  data=work.y2003 force;
      run;
    3. proc append base=work.y2003
                  data=work.april force;
      run;
    4. 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?
    Data Set Description for Work.Employees
    Data Set Description for Work.NewHires
    1. Missing values are assigned to Room for the observations that are read in from Work.NewHires.
    2. Missing values are assigned to Room for all of the observations in Work.Employees.
    3. Room is dropped from Work.Employees.
    4. 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 the following is true:
    1. the DATA= data set contains variables that are not in the BASE= data set.
    2. the BASE= data set contains variables that are not in the DATA= data set.
    3. the variables in the DATA= data set are longer than the corresponding variables in the BASE= data set.
    4. the variables in the DATA= data set have a different type than the corresponding variables in the BASE= data set.
..................Content has been hidden....................

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