BookmarkSubscribeRSS Feed
bheinsius
Lapis Lazuli | Level 10

Hi,

running EG4.3 on SAS92 on Windows.

I want to create a gplot with months on the horizontal axis, like:

work.x;

do date='01jan12'd to '31dec12'd;

     actual=1000;

     output;

end;

format date date9.;

run;

axis1 order='01jan12'd to '31dec12'd by month;

proc gplot data=work.x;

plot actual*date / haxis=axis1;

run;quit;

my graph looks like this:

Screenshot at 2012-04-19 23:30:26.png

the horizontal axis is strange, what did I do wrong?

thanks, Bart

2 REPLIES 2
MikeZdeb
Rhodochrosite | Level 12

hi ... first, you cannot do this by month ... axis1 order='01jan12'd to '31dec12'd by month;

since the end date does not allow an entire month interval and you will not get any dates in December other than 12/01

but you can do this ... axis1 order='01jan12'd to '01jan13'd by month;

second, I tried your code in both V9.1 and V9.3 and got the attached

they are both from V9.3 and they both worked better than what you are showing ... are you showing all the various options that are in place

did you try starting with GOPTIONS RESET=ALL;

ps I'm NOT using EG so I have no idea if that's the issue here


use_31dec12.png
use_01jan13.png
bheinsius
Lapis Lazuli | Level 10

both your suggestions:

- to '01jan13'd

- goptions reset=all

solved the problem.

wrt 2, looks like eg sets some goptions that I'm not aware of.

thanks, Bart

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 1775 views
  • 1 like
  • 2 in conversation