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-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 957 views
  • 3 likes
  • 2 in conversation