SAS P1 L3c Flashcards

1
Q

How are SAS Data sets set up?
table =?
column =?
row=?

A

SAS Data sets:
table = data set
column = variable
row = observation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a variable?

A

Variable = container that stores values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Parts of a data set?

A

Data sets have:

  • descriptor portion
  • data portion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is in descriptor portion of data set?

A
Descriptor portion of data set has
info about attributes of data set
"meta data"
general properties
data set name
when created
variable names
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are data set values?

A

Data values can either be character or numeric.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Write code:
How see descriptors for orion.sales?
How see data values for orion.sales?

A

Descriptors:
PROC CONTENTS data=orion.sales;
RUN;

Data values:
PROC PRINT data=orion.sales;
RUN;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Alignments:
Character values?
Numeric values?

A

Character variables: Left aligned

Numeric variables: Right aligned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a missing value?

Why does it exist?

A

Missing values:

  • in SAS data sets, a value must exist for every variable and observation.
  • if data value is unknown for particular observation, a “missing value” is recorded instead.
  • the variable type determines what is recorded.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is seen if missing values is
character?
numeric?
Can they be altered?

A
Missing values:
character = blank
numeric = . (period)
These are default; can be altered via
MISSING='character'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Are missing values valid values in SAS data sets?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are 2 kinds of SAS variable attributes?

A

SAS variable attributes:

type and length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is included in character type of attribute?

A

characters can be letters, numbers, special char, blanks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is included in numeric type of attribute?

A

numeric type can only be numeric values, including:
“-“ for negative
“E” for scientific notation
“.” single decimal point

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is length?
length for Character?
length for Numeric?

A
Length = LEN
# of bytes used to store data
Length is related to variable type
CHARACTER = 1 to 32,767 bytes
1 byte = 1 character
NUMERIC = 8 bytes by default
stored as floating point or binary => 16 or 17 significant digits
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Are there other variable attributes?

A

yes, ex: format, etc – will learn later

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
SAS naming conventions: Variable names?
length?
start?
contain?
case?
appearance in reports?
A

Variable names SAME as data set names:

  • 1 to 32 characters long
  • start with letter or underscore
  • continue with any combo of #, letter, underscore
  • any case (upper, lower mixed)
  • SAS creates any variable name in the same case when you first specify it => how it will appear in reports
  • but can refer to it in any way in code without affecting anything
17
Q
SAS naming conventions: Data set names?
length?
start?
contain?
case?
appearance in reports?
A

SAME as variable names:

  • 1 to 32 characters long
  • start with letter or underscore
  • continue with any combo of #, letter, underscore
  • any case (upper, lower mixed)
  • SAS creates any variable name in the same case when you first specify it => how it will appear in reports
  • but can refer to it in any way in code without affecting anything
  • extra info about special char in variable names