04-21-2017 09:52 AM
I want to use where statement to select a date between two character dates(date9.)..
what I have written is like:
data class1.dev_data1; set class1.new_dev3; where '01MAY2013'd < Loan_disbursement_date_ < '30APR2014'd; run;
but it gives a error as "Where clause operator requires compatible variables".
04-21-2017 10:07 AM
Did you not ask the same question a few days back? If not then there is a question from a few days back exactly the same. What this is telling you is that the variable
Is not a numeric variable. Dates and times are numerics and you cannot compare something which is not numeric with numerics in that kind of logic sequence. Fixing your data so that the date is actually a numeric SAS date would sort this, so would:
data class1.dev_data1; set class1.new_dev3; where '01MAY2013'd < input(Loan_disbursement_date_,date9.) < '30APR2014'd; run;
Assuming that it is in date9. format.