SAS P1 L3c Flashcards
How are SAS Data sets set up?
table =?
column =?
row=?
SAS Data sets:
table = data set
column = variable
row = observation
What is a variable?
Variable = container that stores values
Parts of a data set?
Data sets have:
- descriptor portion
- data portion
What is in descriptor portion of data set?
Descriptor portion of data set has info about attributes of data set "meta data" general properties data set name when created variable names
What are data set values?
Data values can either be character or numeric.
Write code:
How see descriptors for orion.sales?
How see data values for orion.sales?
Descriptors:
PROC CONTENTS data=orion.sales;
RUN;
Data values:
PROC PRINT data=orion.sales;
RUN;
Alignments:
Character values?
Numeric values?
Character variables: Left aligned
Numeric variables: Right aligned
What is a missing value?
Why does it exist?
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.
What is seen if missing values is
character?
numeric?
Can they be altered?
Missing values: character = blank numeric = . (period) These are default; can be altered via MISSING='character'
Are missing values valid values in SAS data sets?
Yes
What are 2 kinds of SAS variable attributes?
SAS variable attributes:
type and length
What is included in character type of attribute?
characters can be letters, numbers, special char, blanks
What is included in numeric type of attribute?
numeric type can only be numeric values, including:
“-“ for negative
“E” for scientific notation
“.” single decimal point
What is length?
length for Character?
length for Numeric?
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
Are there other variable attributes?
yes, ex: format, etc – will learn later