« _n_ variable in SAS | Main | Importing files in SAS »

January 07, 2013

Where statements in the DATA step


Select a subset of data set that contains only NULLS:

data work.testnulls;
set work.test;
where PushStringToMainIw = ' ';
drop DOB TIMEZONE;
RUN;

Select subset of data where a given column contains a value. This gets into some regex for SAS

- the percent sign (%) replaces any number of characters
- the underscore (_) replaces one character


data work.testnulls;
set work.test;
where PushStringToMainIw LIKE '10-1xxx-003%' ;
RUN;

Posted by kkwaiser at January 7, 2013 11:44 AM

Comments

Login to leave a comment. Create a new account.