There has to be a simpler solution to this and I am not sure why I'm having so much difficulty. I have two date vars, with date9. format. I simply want to create a new date variable in the same data step based on these two variables, but can't without it converting to numeric (or character if I try and use 'put' statements but then my 'format new_date date9.' step doesn't work . help?
I'm trying:
data data1;
set data;
if date1^='' and date2^='' then new_date=date1;
else if date2='' then new_date=date1;
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.