SAS 3
input variable format /;
a relative line pointer control form
input #n variable informat;
absolute line pointer control form
by statement in the data step
allows SAS to process data in groups
concatenation operator !! or ||
another way to join character strings, put this between the two you want to join
numeric missing value
automatic char-to-num conversion returns this when the character value doesn't conform to standard numeric notation
input @starting-position variable informat; or input +positions variable informat;
forms for reading data using formatted input form
input function
function that returns the value produced when the source is read with a specified format
find function
function that searches a target string for a specified string, returns the starting position of the first occurrences if that string is found
trimn
function that's like trim but returns a null string if there are zero blanks while trim returns blank
scan function
function used to extract words from a character value when the relative order of words is known but their starting positions are not
input and put
functions to explicitly convert data
substr function on the right side of an expression
gives a variable the value of specified characters extracted from a specific string
single trailing @
holds a raw data record in the input buffer, pointer position doesn't change, no new record is read into the buffer, next input statement continues to read the same one
best12. and right aligned with leading blanks
how the character value is written with an automatic number-to-character conversion
rename the variable, name the old variable with an input statement of the new variable, drop the new variable
how to create a new variable with the same name just a different type
use multiple input statements
how to load multiple lines of record into an observation
relative line pointer control
in an input statement, moves the pointer relative to the line on which it is currently positioned
absolute line pointer control
in an input statement, moves the pointer to a specific line in a group of lines
percentw.d
informat that divides the number by 100 if it is followed by a percent sign
sum statement
initializes the variable to zero, automatically retains it, increases the value of the variable by an expression for each observation, ignores missing values
input ... @;
input form when there are mixed record types
of
keyword that must be used in a variable list
_all_, _numeric_, _character_
names of special SAS name lists
subsetting If statement that says Last.By-variable is true
only writes total accumulated amount to the output
I, case-insensitive search, or T, search ignores trailing blanks
possible values of modifiers in character functions
retain statement
prevents SAS from reinitializing the values of new variables at the top of the data step
retain variable <initial-value>;
retain statement form
length function
returns the length of a non-blank character string, excluding trailing blanks
propcase function
returns the string with all the first letters of each word capitalzied
_character_, sum~of _character_~
special SAS name list that specifies all character variables that are already defined in the current data step
_numeric_, sum~of _numeric_~
special SAS name list that specifies all numeric variables that are already defined in the current data step
_all_, sum~of _all_~
special SAS name list that specifies all variables that are already defined in the current data step
formatted input
standard and nonstandard data in fixed columns
list input
standard and nonstandard data separated by blanks or some other delimiter
column input
standard data in fixed columns
named input
standard data that is preceded by the name of the variable and an equal sign
variable + expression;
sum statement form
catq function
function that concatenates character or numeric values by using a delimiter to separate items and by adding quotation marks to strings that contain the delimiter
cat function
function that does not remove leading or trailing blanks from the arguments before concatenating them
compress function
function that removes characters listed in the chars argument from the source
cats function
function that removes leading and trailing arguments from the blanks before concatenating them
catx function
function that removes leading and trailing blanks, inserts delimiters, and returns a concatenated character string
catt function
function that removes trailing blanks from the arguments before concatenating them
tranwrd function
function that replaces or removes all occurrences of a given word (or a pattern of characters) within a character string, doesn't remove trailing blanks
round function
function that returns a value rounded to the nearest multiple of rounding unit
floor function
function that returns the greatest integer less than or equal to to the argument
int function
function that returns the integer portion of the argument
ceil function
function that returns the smallest integer greater than or equal to the argument
put function
function that returns the value produced when source is written with format
NewVar = string1 !! string2;
form of concatenation operator being used
position = find~string, substring<, modifiers, startpos>~;
form of find function
NumVar = input~source, informat~;
form of input function
NewVar = length~argument~;
form of length function
NewVar = propcase~string<, delimiter(s)>~;
form of propcase function, all delimiters must be included if any are
CharVar = put~source, format~;
form of put function
set dataSet~rename=~oldName=newName~~;
form of rename= option
NewVar = round~argument<, rounding-unit>~;
form of round function
NewVar = scan~string, <->n<, delimiter(s)>~;
form of scan function
NewVar = substr~string, start<,length>~;
form of substr function on the right side of an expression
lowcase~string~
form of the function that converts all letters in an argument to lowercase
upcase~string~
form of the function that converts all letters in an argument to uppercase
left~string~
form of the function that left-aligns a character expression
strip~string~
form of the function that removes all leading and trailing blanks from a character string
compbl~string~
form of the function that removes multiple blanks from a character string by translating each occurrence of two or more consecutive blanks into a single blank
@n, +n, +(-n)
column pointer controls for reading data using formatted input
trim~string~
form of the function that removes trailing blanks from a character string
char~string, position~
form of the function that returns a single character from a specified position in a character string
right~string~
form of the function that right-aligns a character expression
NewVar = tranwrd~source, target, replacement~;
form of tranwrd function
cmiss
descriptive statistics function that returns the count of missing character or numeric functions
nmiss
descriptive statistics function that returns the count of missing numeric arguments
n
descriptive statistics function that returns the count of nonmissing arguments
sum, mean, min, max, n, nmiss, cmiss
descriptive statistics functions
sum, mean, min, max
descriptive statistics functions that ignore missing values in their arguments
less than 0
for what values do the ceil and int functions return the same values
greater than or equal to 0
for what values do the floor and int functions return the same values
NewVar = cat~string-1, ... , string-n~;
form of cat function
NewVar = catq~modifiers, <delimiter,> string-1, ... , string-n~;
form of catq function
NewVar = cats~string-1, ... , string-n~;
form of cats function
NewVar = catt~string-1, ... , string-n~;
form of catt function
NewVar = catx~separator, string-1, ... , string-n~;
form of catx function
NewVar = ceil~argument~; and NewVar = floor~argument~; and NewVar = int~argument~;
form of ceil function and floor function and int function
NewVar = compress~source<, chars>~;
form of compress function
First.By-variable and Last.By-variable
two temporary variables created by a by statement in the data step
line pointer control
used in input statements to control when SAS loads a new record
substr function on the left side of an expression
used to replace characters of a string
startpos
value in character functions that specifies where the search should start and in what direction
numbered range list, sum~of x1-xn~
variable list that specifies all variables from x1 to xn inclusive, numbers must be consecutive
name range list, sum~of x--a~, sum~of x-numeric-a~, sum~of x-character-a~
variable list that specifies all variables ordered as they are in the PDV from x to a, inclusive, specifies all numeric variables, specifies all character variables
name prefix list, sum~of REV:~
variable list that specifies all variables that begin with REV
0
what First.By-variable equals if it's not the first of a group and what Last.By-variable equals if it's not the last of a group (false)
1
what First.By-variable equals if it's the first of a group and what Last.By-variable equals if it's the last of a group (true)
blanks
what does compress function remove from the source if no chars are listed
null string
what does strip function return if the argument is blank
nth word of a string
what does the scan function return
remainder of the string
what does the substring consist of when length is omitted in the substr function on the right side of an expression
use sum function with retain statement
what to do to create an accumulating variable that involves missing values
use length function nested in substr function
what to do when you want to extract characters of different positions among observations
sorted by the by variable
when using a by statement in the data step, the data set in the set statement must be _______
as soon as all the variables needed to evaluate the condition are assigned values
where is the most efficient place to put a subsetting IF statement