Chapter 11: Defining and Processing Arrays

  1. Correct answer: a
    An ARRAY statement is not an executable statement; it merely defines an array.
  2. Correct answer: d
    The items in an ARRAY statement must be specified in the following order:
    ARRAY array-name[number-of-array-elements]<$ length array-elements _TEMPORARY_ (initial-values)>;
  3. Correct answer: b
    In the DO statement, you specify the index variable that represents the values of the array elements. Then specify the start and stop positions of the array elements.
  4. Correct answer: d
    To create a list of temporary array elements, use the _TEMPORARY_ keyword. The list of initial values must be enclosed in parentheses and separated by commas or blanks.
  5. Correct answer: a
    At the end of the second iteration, diff[i] resolves as follows:
    diff[2]=wt[2+1]-wt[2];
    diff[2]=215-200
  6. Correct answer: a
    In a two-dimensional array, elements are referenced using two numbers. The first number corresponds to the row and the second number corresponds to the column. The dimension values are separated with a comma. Initial values are loaded into a two-dimensional array by specifying the values one row at a time, left to right.
  7. Correct answer: d
    To process all of the elements in an array, you can either use the DIM function with the array name as the argument or you can specify a stop value corresponding to the number of elements in the array.
  8. Correct answer: c
    The IF-THEN statement specifies that the Targets array is loaded only once, during the first iteration of the DATA step. During the first iteration of the DATA step, the condition _N_=1 is true, so the outer DO loop executes three times—once for each observation in Cert.Ctargets. After the third iteration of the DO loop, the pointer drops down to the second SET statement, and the values from the first observation in Cert.Monthsum are read into the program data vector. During the second iteration of the DATA step, the condition _N_=1 is false. So, the DO loop does not execute again.
Last updated: October 16, 2019
..................Content has been hidden....................

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