BookmarkSubscribeRSS Feed
emikea
Calcite | Level 5

The following log message appears when I run the macro below.


NOTE: Time axis can only support date time values. The axis type will be changed to LINEAR.

NOTE: The column format DATE9 is replaced by an auto-generated format on the axis.


Although the bands display as I want them to, the BAND statement is forcing my X AXIS to be converted to LINEAR even though it is initially formatted as a DATE9.

This creates some formatting issues for me. When I remove the BAND statements, I don't have this issue. Any thoughts on how to prevent this forced conversion would be appreciated.


%MACRO PLOT_SINGLE_SERIES_PANELBY(PANELBY = , IMAGENAME = , DATASET = , VARIABLE = , CHARTTITLE = , FOOTNOTE = , WHERE = );

      ODS GRAPHICS ON / RESET=ALL IMAGENAME = "&IMAGENAME." NOBORDER BORDER=OFF;

      GOPTIONS RESET = (TITLE FOOTNOTE);

      TITLE1 "&CHARTTITLE.";

      FOOTNOTE JUSTIFY =RIGHT HEIGHT = .8 "&FOOTNOTE.";

      PROC SGPANEL DATA=&DATASET.

            (WHERE = (&WHERE.)) NOAUTOLEGEND;

/*    format sasdate YYQ4.;*/

            PANELBY &PANELBY. / LAYOUT = ROWLATTICE NOVARNAME ROWHEADERPOS = RIGHT ONEPANEL;

            BAND Y= &VARIABLE. UPPER = '30JUN2009'D LOWER = '31DEC2007'D;

            BAND Y= &VARIABLE. UPPER = '31MAR2001'D LOWER = '30NOV2001'D;

            SERIES X = SASDATE  Y = &VARIABLE. / MARKERS  LINEATTRS=(COLOR=RED);

            ROWAXIS DISPLAY = (NOLABEL);

            COLAXIS DISPLAY = (NOLABEL) TYPE=TIME;

      RUN;

      GOPTIONS RESET = (TITLE FOOTNOTE);

%MEND PLOT_SINGLE_SERIES_PANELBY;

3 REPLIES 3
PGStats
Opal | Level 21

You should try with :

COLAXIS DISPLAY = (NOLABEL) TYPE=TIME TICKVALUEFORMAT=DATE9.;

PG

PG
emikea
Calcite | Level 5

Thanks PGStats. That does allow me to format the axis, although I still get the message in the log window that the axis is converted to linear.

PGStats
Opal | Level 21

Maybe you could try using variables instead of constants for the bands :

data _&DATASET. / view=_&DATASET.;

set &DATASET. (WHERE = (&WHERE.));

format UPPER1 UPPER2 LOWER1 LOWER2 date9.;

UPPER1 = '30JUN2009'D;

LOWER1 = '31DEC2007'D;

UPPER2 = '31MAR2001'D;

LOWER2 = '30NOV2001'D;

run;

PROC SGPANEL DATA=_&DATASET. NOAUTOLEGEND;

...

BAND Y= &VARIABLE. UPPER = UPPER1 LOWER = LOWER1;

BAND Y= &VARIABLE. UPPER = UPPER2 LOWER = LOWER2;

...

PG

PG

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1742 views
  • 3 likes
  • 2 in conversation