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.

Studying Progress

0%
New cards
32
Still learning
0
Almost done
0
Mastered
0
32 Terms
1
New cards

Array

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

New cards
2
New cards

Array statement

Used to create the array

New cards
3
New cards

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

True

New cards
4
New cards

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
New cards

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
New cards

By placing the array in a DO Loop you can

process each variable in the array

New cards
7
New cards

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
New cards

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

numeric or character variables

New cards
9
New cards

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
New cards

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

asterisk

New cards
11
New cards

The keyword _CHARACTER_ is used as

the variable list

New cards
12
New cards

Because the _CHARACTER_ follows the SET statement, it includes all

the character variables in the Chars data set

New cards
13
New cards

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
New cards

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

True

New cards
15
New cards

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
New cards

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

1

New cards
17
New cards

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
New cards

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

True

New cards
19
New cards

Elements of temporary arrays are great places to….

store values or perform table lookups

New cards
20
New cards

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
New cards

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
New cards

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
New cards

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

corresponding variables

New cards
24
New cards

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

True

New cards
25
New cards

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
New cards

The value of _N_ counts the

Iterations of the DATA step

New cards
27
New cards

SAS arrays may be multidimensional, true or false?

True

New cards
28
New cards

Describe a multidimensional array

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

New cards
29
New cards

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

row and column indices

New cards
30
New cards

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
New cards

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
New cards

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 13 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 80 people
Updated ... ago
5.0 Stars(6)
note Note
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 6 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 4 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 65 people
Updated ... ago
5.0 Stars(2)

Explore top flashcards

flashcards Flashcard47 terms
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard188 terms
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard159 terms
studied byStudied by 31 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard159 terms
studied byStudied by 2 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard85 terms
studied byStudied by 13 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard35 terms
studied byStudied by 50 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard253 terms
studied byStudied by 311 people
Updated ... ago
3.8 Stars(6)
flashcards Flashcard46 terms
studied byStudied by 530 people
Updated ... ago
4.6 Stars(10)