I'm overlaying cumulative distributions from multiple years in one plot, plotting the cumulative percentage by date. I had to convert all dates to the same year to get them to all plot on the same xaxis. The xaxis tick marks are months, but SAS insists on showing the year on this axis. The date values are formatted as 'MMDDYY4.' but SAS overrides the formats and uses auto date formats.
Is there any way to format the x axis to display only the month?
proc sgplot data=CumulH;
series x=dummydate y=cum_pct/group = year;
xaxis label='Date' max = '01DEC2000'd;
Thanks, tried formatting dummydate as MONNAME3., and even though the data appear in that format in the data file the plot still ignores it.
The log shows:
NOTE: The column format MONNAME3 is replaced by an auto-generated format on the axis.
I should have mentioned in the original post that I am using SAS 9.3 TS 1M0.
Thanks, interesting idea. I was looking for a way to override the default format. I should have mentioned in the original post that I'm using SAS 9.3. The valuesformat option is not listed for the xaxis statement in the SAS 9.3 ODS Graphics Procedures Guide (Second Edition). Is that available in SAS 9.4? I tried it anyway, and this was the log response:
627 xaxis label='Date' max = '01DEC2000'd valuesformat=mmddyy4.;
WARNING 1-322: Assuming the symbol VALUES was misspelled as valuesformat.
ERROR 79-322: Expecting a (.
ERROR 76-322: Syntax error, statement will be ignored.
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 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.