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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.