data patients1;
set patients;
format authorisation ddmmyy10.;
if NIS_Nummer in (2628,3078,6791) then authorisation='11Jan2008'd;
if NIS_Nummer in (2408) then authorisation='28Aug2007'd;
if NIS_Nummer in (6759) then authorisation='18Sep2014'd;
if NIS_Nummer in (2311,5361,6887) then authorisation="23Apr2007"d;
if NIS_Nummer in (6687) then authorisation="03Aug2009"d;
if NIS_Nummer in (6667) then authorisation="27May2015"d;
run;
data datensatz_pms;
set datensatz_pms;
format n_date ddmmyy10.;
n_date = input(notificationdate,ddmmyy10.);
if '01jan2013'd <= n_date <= '31dec2013'd then year=2013;
if '01jan2014'd <= n_date <= '31dec2014'd then year=2014;
if '01jan2015'd <= n_date <= '31dec2015'd then year=2015;
if '01jan2016'd <= n_date <= '31dec2016'd then year=2016;
if '01jan2017'd <= n_date <= '31dec2017'd then year=2017;
run; Dear community, thank you for your instant support when i am struggeling with sas. I need your help again. Now I have to measure the difference between two date Variables (notification date and authorisation date) and if the time difference between the authorisation date and the notification date is shorter than 2 years I its a newly authorised drug and if the time difference is longer than 2 years its not a newly authorised drug. I need Sas to create me a new variable with that information(newly authorised: yeys/no). But how to create this variable? I really need your support with this as I have absolutely no idea^^
... View more