Thank you! But there are so many errors in flag creation. My date columns have null values ie missing values in the table.. 1.When I use this command with proc sql, intck('day', dt_discharge,dt_death) le 30 as flg_30d , when dt_death has missing values it should give 0 as output but it is returning 1. 2. Also, flg_30d or flg_rf as flg_x_30d cannot be used as such in proc sql right? I suppose I should use the entire expressions intck('day', dt_discharge,dt_death) le 30 or intck('day', date_of_discharge, death_date) le 60 as flg_60d as flg_x_30d in proc sql to flag those variables. 3. There is another expression in intck('day', dt_discharge,dt_admission) where I have to find the difference between discharge date and second successive admission date to hospital. So how would I find second instance of dt_admission ? kindly help....
... View more