SAS Quiz 4- Chapter 13

studied byStudied by 3 people
5.0(1)
Get a hint
Hint

Array

1 / 31

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

32 Terms

1

Array

A collection of elements (normally SAS variables) that allow you to write SAS statements referencing this group of variables

New cards
2

Array statement

Used to create the array

New cards
3

Array names follow the same rules you use for SAS Variables. True or False?

True

New cards
4

Describe the syntax of an Array statement

Following the keyword ARRAY is the name you chose for your array. Array names follow the same rules you use for SAS variables. Following the array name, place the number of elements in brackets. Lastly, list the variables you want to include in the array. May use SAS shorthand for referring to a list of variables here, such as Var1-Varn

New cards
5

You may use ( ) or ( ) following the array name to specify the number of elements in the array

You may use square brackets [ ] or parentheses ( ) following the array name to specify the number of elements in the array

New cards
6

By placing the array in a DO Loop you can

process each variable in the array

New cards
7

Since we do not need or want the DO loop counter included in the SAS data set, we can use the

DROP statement

New cards
8

SAS arrays must contain all ( ) or all ( ) variables

numeric or character variables

New cards
9

If the variables you want to include in a character array are already defined as character then you can ( )

If the variables you want to include in a character array are already defined as character (for example, they are coming from a SET statement), you can write an ARRAY statement resembling the one in the previous section.

New cards
10

If you do not know the amount of variables in an array you can use an

asterisk

New cards
11

The keyword _CHARACTER_ is used as

the variable list

New cards
12

Because the _CHARACTER_ follows the SET statement, it includes all

the character variables in the Chars data set

New cards
13

Describe how to convert all character values to Propercase

May use the keyword _CHARACTER_ to reference all the character variables in the data set and then use a DO loop to convert all the values to Propercase

New cards
14

You can include variables in an ARRAY statement that does not exist in your SAS data set, True or False?

True

New cards
15

When creating a new variable- If no variables are listed and the number of elements is specified, SAS creates….

If no variables are listed and the number of elements is specified, SAS creates variable names automatically given by the name of the array followed by 1 to n such that n is the length of the array

New cards
16

By default, SAS numbers the elements of an array starting from…

1

New cards
17

Describe how to specify the beginning and ending values of the array elements…

You can use the lower and upper bounds in the brackets. following the array name and separate them with a colon

array Income {2010:2017} Income2010-Income2017;

array Income Taxes {2010:2017} Taxes2010-Taxes2017;

New cards
18

True or False? You can create an array that only has elements and no variables!

True

New cards
19

Elements of temporary arrays are great places to….

store values or perform table lookups

New cards
20

When can you assign the array elements initial values…

You can assign the array elements initial values when you create the temporary array or you can load values into the temporary array in the DATA step

New cards
21

Values in the temporary array are automatically retained; True or False

True, they are not set to missing values when the DATA step iterates.

New cards
22

What tells SAS that an array is temporary

_TEMPORARY_ tells SAS that this is a temporary array and the values in parentheses are the initial values for each of the elements of this array

New cards
23

Its important to remember that in making a temporary array, there are no…

corresponding variables

New cards
24

We can also load values for a temporary array from a file… True or False?

True

New cards
25

When loading values for a temporary array from a raw data file, we would use the value of _N_ when…

We use the value of N, when we want to read the first line of the data file, differently from the other lines. _N_ can be used to ensure that the answer key values are read only once.

New cards
26

The value of _N_ counts the

Iterations of the DATA step

New cards
27

SAS arrays may be multidimensional, true or false?

True

New cards
28

Describe a multidimensional array

Instead of having a single index to reference an element, we have multiple indices

New cards
29

When we have two dimensions, we can think of them as….

row and column indices

New cards
30

Describe how to define a multidimensional array

Specify the number of elements in each dimension in the brackets, following the array name, separated by commas

New cards
31

How would we define an array called MULTI with 3 elements on the first dimension and five elements on the second dimension

array Multi {3, 5} X1-X15;

New cards
32

To determine the number of elements in an multidimensional array…

you multiply the number of elements in each dimension

New cards

Explore top notes

note Note
studied byStudied by 44 people
Updated ... ago
5.0 Stars(3)
note Note
studied byStudied by 67 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 34 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 147 people
Updated ... ago
4.7 Stars(3)
note Note
studied byStudied by 23 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 69 people
Updated ... ago
5.0 Stars(2)

Explore top flashcards

flashcards Flashcard50 terms
studied byStudied by 13 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard25 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard38 terms
studied byStudied by 18 people
Updated ... ago
5.0 Stars(3)
flashcards Flashcard123 terms
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard33 terms
studied byStudied by 69 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard44 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard41 terms
studied byStudied by 3 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard20 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)