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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.