Hi everyone, I am trying to work with a dataset and have been struggling with creating a new variable involving date. In my dataset (.sas7bdat), I have a variable with a date informat (mm/dd/yy10.). What I am trying to do is to create a variable called 'index' that codes 0 if date before 5/1/2010 and 1 if date is after 5/1/2010. I tried to code in a data step: data one; set new; if date>=05/01/2010 then index=1; else index=0; run; When I proc print, the index=1 for all of my observations. What is wrong with my code? I have been struggling for hours.. Please help!! Thank you!
... View more