BookmarkSubscribeRSS Feed
msmyth
Calcite | Level 5

Hello,

I am currently trying to import a csv file into SAS Studio but am encountering formatting issues with the date field.  Specifically I am trying to plot a time series but the program is not interpreting code as intended with the following error message:

WARNING: The bottom horizontal axis labeled "Time" could not be fit as specified. The axis values will overwrite.

Provided below is my code:

data wine;
infile '/ location /wine.csv' dlm=',' firstobs=2;
input Time $ Sales;
run;

proc print data= wine;
run;

proc gplot data=wine;
    title "Time Series Plot of the Australian Wine Sales dataset";
    plot Sales*time;
    symbol1 i=join;
run;

Please note I substituted 'location' for my personal location information for purposes of this discussion.  I have also attached the data set as well.  Thank you!

3 REPLIES 3
jakarman
Barite | Level 11

finding the informats is what you want? SAS(R) 9.4 Formats and Informats: Reference  (monyy)

---->-- ja karman --<-----
Kurt_Bremser
Super User

The message tells you that the values for your x-axis are so many or so wide that adjacent values will overwrite each other, causing bad readability.

Reduce the number of values, or apply a format that renders less characters

GraphGuy
Meteorite | Level 14

By default, there are too many tickmarks on your x (horizontal) axis.

You could specify exactly which tickmarks you want in an axis statement 'order=',

or here's a quick hack to just get tickmark labels at the left & right (just 2 major tickmarks)...

axis1 major=(number=2) minor=none;

proc gplot data=wine;
    title "Time Series Plot of the Australian Wine Sales dataset";
    plot Sales*time / haxis=axis1;
    symbol1 i=join;
run;

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
  • 3 replies
  • 2124 views
  • 0 likes
  • 4 in conversation