03-14-2018 12:14 AM
I have just started on SAS and have converted a text file and done multiple manipulations with it including changing dates into a relavant format.
I have a question, I want to recode one date point (data point 555) from 21/05/2006 to the 15/05/2006 and every method I use ends up with 1/1/1960. I have converted everything to the ddmmyy10. format.
if studyid=555 then melanomadate = 15/05/2006;
This ends up with 1/1/1960
So I then tried
if studyid=555 then melanomadate = ('15/05/2006', ddmmyy10.);
And got error,
03-14-2018 05:14 AM
Your 2nd attempt was actually pretty close. You just forgot to also use the SAS INPUT() function to tell SAS what it should be doing with the date string and the informat.
data test; melanomadate = input('15/05/2006', ddmmyy10.); format melomadate ddmmyy10.; run;