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;
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.
Ready to level-up your skills? Choose your own adventure.