BookmarkSubscribeRSS Feed
BenRB
Calcite | Level 5
I am merging two datasets - one dataset has the date recorded as separate month and year variables. I want to convert these into a single variable for the date in the format mm.yyyy, to match the date variable in the second dataset.
Is this possible? Any advice is appreciated
1 REPLY 1
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello BenRB,

You could use the following code:
[pre]
data i;
month=5;
year=2011;
date=MDY(month,01,year);
format date mmyyp8.;
run;
[/pre]
Sincerely,
SPR

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 857 views
  • 0 likes
  • 2 in conversation