sas - deleting observations based on date -


i trying delete observations date before 02/27/12. output data set same original one, should not be.

data new1; set new; if service_start_date < '02/27/12' or date_of_first_revenue_from_acti < '02/27/12'   delete; run; 

you need use proper date constants, one.

data new1; set new; if service_start_date < '27feb2012'd or date_of_first_revenue_from_acti < '27feb2012'd   delete; run; 

second, may need convert variables proper dates, if stored text. can use input that.

data new1; set new; if input(service_start_date,mmddyy10.) < '27feb2012'd or input(date_of_first_revenue_from_acti,mmddyy10.) < '27feb2012'd   delete; run; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -