sas - How to change a date formatted number into number in SQL -
i meet confusing problem when code sql in sas. code is:
proc sql noprint; select vdte :vdate test1; quit; proc sql; create table test3 select *, cdate>=&vdate. index test2; quit;
i find index=1. there should index=0
, index=1
. when use number instead of macro variable vdate
, eg. 17685(02jun2008) instead of &vdate.
, works!
i checked vdte. type numeric, format ddmmyy10.. vdte number stored in sas! when give &vdate., there problem!!
could me understand situation?
thanks, andrea
if vdte has sas date format, need "clear" before storing value macro variable:
proc sql; select vdte format=8. :vdate test1; quit;
then comparison should work fine.
note use date9. format creating macro variable , use cdate>="&vdate"d
in second query.
Comments
Post a Comment