Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. Which statement is false regarding an ARRAY statement?
    1. It is an executable statement.
    2. It can be used to create variables.
    3. It must contain either all numeric or all character elements.
    4. It must be used to define an array before the array name can be referenced.
  2. What belongs within the braces of this ARRAY statement?
    array contrib{?} qtr1-qtr4;
    1. quarter
    2. quarter*
    3. 1-4
    4. 4 
  3. For the program below, select an iterative DO statement to process all elements in the contrib array.
    data work.contrib; 
       array contrib{4} qtr1-qtr4; 
           ... 
           contrib{i}=contrib{i}*1.25; 
       end; 
    run;
    1. do i=4;
    2. do i=1 to 4;
    3. do until i=4;
    4. do while i le 4;
  4. What is the value of the index variable that references Jul in the statements below?
    array quarter{4} Jan Apr Jul Oct; 
    do i=1 to 4; 
       yeargoal=quarter{i}*1.2; 
    end;
    1. 1
    2. 2
    3. 3
    4. 4
  5. Which DO statement would not process all the elements in the factors array shown below?
     array factors{*} age height weight bloodpr;
    1. do i=1 to dim(factors);
    2. do i=1 to dim(*);
    3. do i=1,2,3,4;
    4. do i=1 to 4;
  6. Which statement below is false regarding the use of arrays to create variables?
    1. The variables are added to the program data vector during the compilation of the DATA step.
    2. You do not need to specify the array elements in the ARRAY statement.
    3. By default, all character variables are assigned a length of eight.
    4. Only character variables can be created.
  7. For the first observation, what is the value of diff{i} at the end of the second iteration of the DO loop?
    Variables in an Array
    array wt{*} weight1-weight10; 
    array diff{9}; 
    do i=1 to 9; 
       diff{i}=wt{i+1}-wt{i}; 
    end;
    1. 15
    2. 10
    3. 8
    4. -7
  8. Finish the ARRAY statement below to create temporary array elements that have initial values of 9000, 9300, 9600, and 9900.
     array goal{4} ... ;
    1. _temporary_ (9000 9300 9600 9900)
    2. temporary (9000 9300 9600 9900)
    3. _temporary_ 9000 9300 9600 9900
    4. (temporary) 9000 9300 9600 9900
Last updated: January 10, 2018
..................Content has been hidden....................

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