Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. Which SAS statement correctly specifies the array Sales as illustrated in the following table?
    Table Representation of Sales Array
    Table Representation of Sales Array
    1. array Sales{3,4} m1-m12;
    2. array Sales{4,3} m1-m12;
    3. array {3,4} Sales m1-m12;
    4. array {4,12} Sales m1-m12;
  2. Which of the following statements creates temporary array elements?
    1.  array new {*} _temporary_;
    2. array new {6} _temporary_;
    3. array new {*} _temporary_ Jan Feb Mar Apr May Jun;
    4. array _temporary_ new {6} Jan Feb Mar Apr May Jun;
  3. Which DO statement processes all of the elements in the Yearx array?
    array Yearx{12} Jan--Dec;
    1. do i=1 to dim(yearx);
    2. do i=1 to 12;
    3. do i=Jan to Dec;
    4. a and b
  4. Given the following program, what is the value of Points in the fifth observation in the data set Work.Results?
    SAS Data Set Work.Contest
    data work.results; 
       array score{2,4} _temporary_            
             (40,50,60,70,40,50,60,70);
       set work.contest;
       Points=score{week,finish}; 
    run;
    data work.results
    1. 40
    2. 50
    3. 60
    4. 70
  5. Array values should be stored in a SAS data set when which of the following is true?
    1. There are too many values to initialize easily in an array.
    2. The values change frequently.
    3. The same values are used in many programs.
    4. All of the above.
  6. Given the following program, which statement is not true?
    data work.lookup1;
       array Targets{1997:1999,12} _temporary_; 
       if _n_=1 then do i= 1 to 3;
    	           set sasuser.ctargets;
    	           array Mnth{*} Jan--Dec;
    	           do j=1 to dim(mnth);
    	              targets{year,j}=mnth{j};
    	           end;
       end;
       set sasuser.monthsum(keep=salemon revcargo monthno);
       year=input(substr(salemon,4),4.); 
       Ctarget=targets{year,monthno}; 
    run;
    1. The IF-THEN statement specifies that the Targets array is loaded once.
    2. During the first iteration of the DATA step, the outer DO loop executes three times.
    3. After the first iteration of the DO loop, the pointer drops down to the second SET statement.
    4. During the second iteration of the DATA step, the condition _N_=1 is false. So, the DO loop does not execute.
  7. Given the following program, which variable names will appear in the data set Work.New?
    SAS Data Set Work.Revenue
    proc transpose 
         data=work.revenue
         out=work.new;
    run;
    proc transpose
    1. Year, Jan, Feb, Mar, Apr
    2. Year, 2000, 2001, 2002
    3. _NAME_, Col1, Col2, Col3
    4. _NAME_, Jan, Feb, Mar, Apr
  8. Which program creates the output data set Work.Temp2?
    SAS Data Set Work.Temp
    SAS Data Set Work.Temp2
    SAS Data Set Work.Temp
    SAS Data Set Work.Temp2
    1. proc transpose data=work.temp
           out=work.temp2
           prefix=Quarter;
      run;
    2. proc transpose data=work.temp
           out=work.temp2
           name=Month
           prefix=Quarter;
      run;
    3.  proc transpose data=work.temp
            out=work.temp2
            prefix=Month
            name=Quarter;
       run;
    4. proc transpose data=work.temp
           out=work.temp2
           prefix=Month
           index=Quarter;
      run;
  9. Which version of the data set Work.Sales2 is created by the following program?
    SAS Data Set Work.Sales
    proc transpose data=work.sales
         out=work.sales2
         name=Week;
         by employee; 
    run;
    proc transpose
    1. observations
    2. Observations
    3. Observations
    4. Observations
  10. Which program creates the data set Work.Fishsize?
    SAS Data Set Work.Fishdata
    Observations
    SAS Data Set Work.Fishsize
    observations
    1. proc transpose data=work.fishdata
           out=work.fishsize
           prefix=Measurement;
      run;
    2. proc transpose data=work.fishdata
           out=work.fishsize
           prefix=Measurement;
           by location;
      run;
    3. proc transpose data=work.fishdata
           out=work.fishsize
           prefix=Measurement;
           by date;
      run;
    4. proc transpose data=work.fishdata
           out=work.fishsize
           prefix=Measurement;
           by location date;
      run;
..................Content has been hidden....................

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