ST 307 Lecture Notes - Lecture 7: Substring, Mnemonic
Document Summary
Filtering or subsetting observations only work with observations that meet some criteria (often includes only looking at observations that fall within certain dates or certain groups) Need to know logical comparison operators in sas! Can use the mnemonic equivalent eq instead of = sign, etc. Where statement cannot use for raw data sets, only sas sets. Where statecode = nc | statecode = pa ; Where statecode = nc & x < 0. 25; Where commonly used in a data step! Recall set will copy an existing sas data set. If statecode in ( nc , pa , sc , al ) then delete; If statecode in ( sc , nc ) then statetype = carolina ; If condition true, new variable takes on carolina . Can be used when reading raw data. Where statement only used on sas data set. Where can be applied as a data set option (not covered) Drop and keep select variables to remove or include.