Hi, I want to know the days between diagnosis and treatment. all dates are between 2017 to 2019. /*Calculating timeframe between treatment and diagnosis*/ data CDCSTVST.CDC_Site_Timeframe; set CDCSTVST.CDC_Site_PositiveOnly; days=(INTCK('day', colldate1, Treatment_Date1));/*Colldate is the date diagnosis date and Treatment_date1 is the treatment date*/ put days=; run; /*Categorizing days*/ data CDCSTVST.CDC_Site_Timeframe2; set CDCSTVST.CDC_Site_Timeframe1; if days=0 then timeframe="sameday"; if days < 7 and days >0 then timeframe="Week"; if days < 15 and days >7 then timeframe="2Weeks"; if days < 21 and days >15 then timeframe="3weeks"; if days < 28 and days >21 then timeframe="4weeks"; if days = >28 then timeframe=">4weeks"; run; /*Checking to see if the code above worked*/ Proc freq data=CDCSTVST.CDC_Site_Timeframe2; table days*timeframe/norow nocol nopercent; run; The out put is : days timeframe 2Weeks 3weeks 4weeks >4weeks Week sameday Total -31 0 0 0 0 0 0 0 -21 0 0 0 0 0 0 0 -13 0 0 0 0 0 0 0 -6 0 0 0 0 0 0 0 -2 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 653 0 1 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 6 0 0 0 0 8 0 0 12 0 0 0 0 13 0 0 14 0 0 0 0 2 0 0 Why i am getting negative numbers? Please help me.
... View more