BookmarkSubscribeRSS Feed
erikhendrickson
Calcite | Level 5
I am trying to figure out how to make my xaxis with the weekly intervals list the end of week (Saturday) rather than the start of the week (Sunday). Any help would be greatly appreciated. proc sgplot data=merged_gender (where=(&period)) dattrmap=attrmap; title1 "Opioid Encounters by Gender"; yaxis label="Number of Encounters"; series y=MovAv_OPIOID_ENCOUNTER x=admitdt1 / group=gender attrid=gender name="series1" lineattrs=(pattern=solid thickness=2); reg y=OPIOID_ENCOUNTER x=admitdt1 / group=gender nomarkers attrid=gender lineattrs=(pattern=dash thickness=2); xaxis label="Encounter Date" tickvalueformat=mmddyy8. interval=week offsetmin=0 offsetmax=0; symbol1 interpol=join width=10 ci=cxEC8B16 cv=cx546EF0; keylegend "series1" / title=''; run;
3 REPLIES 3
Ksharp
Super User
data have;
call streaminit(123);
do date='04jan2020'd to '01jun2020'd;
y=rand('uniform');output;
end;
format date date9.;
run;

proc sgplot data=have;
series x=date y=y;
xaxis type=linear  values=('04jan2020'd to '01jun2020'd by week) fitpolicy=rotate ;
run;
erikhendrickson
Calcite | Level 5

Thank you!

 

Is there a way to do the same process but with a date format mmddyy8. ?

Ksharp
Super User
of course. Just change format:
format date date9.;
---->
format date mmddyy8.;

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 16. 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
  • 677 views
  • 3 likes
  • 2 in conversation