SAS Chapter 16 Processing Variables With Arrays

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 21,992
| Attempts: 633 | Questions: 10
Please wait...
Question 1 / 10
0 %
0/100
Score 0/100
1. 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;

Explanation

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.

Submit
Please wait...
About This Quiz
SAS Chapter 16 Processing Variables With Arrays - Quiz

This quiz covers SAS Chapter 16, focusing on processing variables using arrays. It evaluates understanding of ARRAY statements, iterative DO loops, and index variable identification. Essential for learners... see moreaiming to enhance their SAS programming skills. see less

2. What belongs within the braces of this ARRAY statement? array contrib{?} qtr1-qtr4;

Explanation

The value in parentheses indicates the number of elements in the array. In the case, there are four elements.

Submit
3. What is the value of the index variable that references Jul in the statements below? array quarters{4} Jan Apr Jul Oct; do i=1 to 4;    yeargoal=quarter{1}*1.2; end;

Explanation

The index value represents the positions of the array element. In this case, the third element is Jul.

Submit
4. Finish the ARRAY statement below to create temporary array elements that have initial values of 9000, 9300, 9600, and 9900. array goal{4} ... ;

Explanation

To create temporary array elements, specify _TEMPORARY_ after the array name and dimension. Specify an initial value for each element, separated by either blanks or commas, and enclose the values in parentheses.

Submit
5. Select the ARRAY statement that defines the array in the following program. data rainwear.coat;    input category high1-high3 / low1-low3;    ...    do i=1 to 2;       do j=1 to 3;          compare{i,j}=round(compare{i,j}*1.12);       end;    end; run;

Explanation

The nested DO loops indicate that the array is named compare and is a two-dimensional array that has two rows and three columns.

Submit
6. Which statement is false regarding an ARRAY statement?

Explanation

An array statement is not an executable statement; it merely defines an array.

Submit
7. Which statement below is false regarding the use of arrays to create variables?

Explanation

Either numeric or character variables can be created by an ARRAY statement.

Submit
8. For the first observation, what is the value of diff{i} at the end of the second iteration of the DO loop?

Explanation

At the end of the second iteration, diff{i} resolves as follows:
diff{2}=wt{2+2};
diff{2}=215-200

Submit
9. Which DO statement would not process all the elements in the factors array shown below? array factors{*} age height weight bloodpr;

Explanation

To process all the elements in an array, you can either specify the array dimension or use the DIM function with the array name as the argument.

Submit
10. Based on the ARRAY statement below, select the array reference for the array element q50. array ques{3,25} q1-q75;

Explanation

This two-dimensional array would consist of three rows of 25 elements. The first row would contain q1 through q25, the second row would start with q26 and end with q50, and the third row would start with q51 and end with q75.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 11, 2013
    Quiz Created by
    Moxleyv
Cancel
  • All
    All (10)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
For the program below, select an iterative DO statement to process all...
What belongs within the braces of this ARRAY statement?...
What is the value of the index variable that references Jul in the...
Finish the ARRAY statement below to create temporary array elements...
Select the ARRAY statement that defines the array in the following...
Which statement is false regarding an ARRAY statement?
Which statement below is false regarding the use of arrays to...
For the first observation, what is the value of diff{i} at the end of...
Which DO statement would not process all the elements in the...
Based on the ARRAY statement below, select the array reference for the...
Alert!

Advertisement