BookmarkSubscribeRSS Feed
maribelchahine
Calcite | Level 5

Hi! I was wondering if anyone could possibly help me. I am asked to plot enrollment by month when enrollment variable is in mm/dd/yyyy format. How can I change it to just mm?

 

3 REPLIES 3
pink_poodle
Barite | Level 11
You can use a month function, month(), to extract the month from that variable.
SASKiwi
PROC Star

You could try the MONYY7. (eg Jan2022) SAS Format. That will ensure your dates are plotted correctly in date order even if they spread over multiple years. 

andreas_lds
Jade | Level 19

A custom date format could help, have a look at the docs of proc format and picture-type-formats. You have to be 100% sure that the source has data of a single year, only and always. If not using the format suggest by @SASKiwi is the easiest route to solve the problem.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 510 views
  • 0 likes
  • 4 in conversation