Hi guys,
My data SUMDATE is like below: I want to combine year and month into a single date column as "monyyyy" (Mar2011 as example). year and month are all numeric.
year | month | cases |
2011 | 1 | 34 |
2011 | 2 | 44 |
2011 | 3 | 56 |
2011 | 4 | 45 |
2011 | 5 | 33 |
2011 | 6 | 44 |
2011 | 7 | 55 |
2011 | 8 | 66 |
2011 | 9 | 32 |
2011 | 10 | 52 |
2011 | 11 | 54 |
2011 | 12 | 56 |
2012 | 1 | 58 |
2012 | 2 | 60 |
2012 | 3 | 62 |
2012 | 4 | 64 |
2012 | 5 | 66 |
2012 | 6 | 68 |
2012 | 7 | 70 |
2012 | 8 | 72 |
2012 | 9 | 74 |
2012 | 10 | 76 |
....more lines | .... | ..... |
What I want is like this:
date1 | cases |
Jan2011 | 34 |
Feb2011 | 44 |
Mar2011 | 56 |
Apr2011 | 45 |
more lines..... | ...... |
Any help would be appreciate!!!
data want;
set have;
date1=mdy(month,1,year);
format date1 monyy7.;
drop year month;
run;
data want;
set have;
date1=mdy(month,1,year);
format date1 monyy7.;
drop year month;
run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.