BookmarkSubscribeRSS Feed
Katie
Obsidian | Level 7

For some reason this code is not working on my computer.  I can not get the color scheme I want to show up.  Can someone else run it and let me know if they experience the same problem?

data work.bp;
  infile datalines;
  input dias losys hisys grp $ 13-33 refx refy;
datalines;
75 110 190 Severe Hypertension 75 140
115 110 190 Severe Hypertension 90 140
75 110 180 Moderate Hypertension 90 190
110 110 180 Moderate Hypertension . .
75 110 160 Mild Hypertension . .
100 110 160 Mild Hypertension . .
75 110 140 High/Normal . .
90 110 140 High/Normal . .
75 110 130 Normal . .
85 110 130 Normal . .
75 110 120 Optimal . .
80 110 120 Optimal . .
;
run;

proc template;
  define style styles.bp;
  parent=styles.listing;
  style graphcolors from graphcolors /
  'gdata6'=CXFFFFFF
  'gdata5'=CXF5D9D8
  'gdata4'=CXEBB3B1
  'gdata3'=CXE18D8A
  'gdata2'=CXD76763
  'gdata1'=CXBF1810;
  end;
run;

ods listing style=bp;
title 'Stages of Hypertension';

proc sgplot data=bp;
  band x=dias lower=losys upper=hisys /
  group=grp name="bp";
  series x=refx y=refy / lineattrs=(thickness=2);
  xaxis values=(75 to 115 by 5) label='Diastolic Pressure (mmHg)';
  yaxis values=(110 to 190 by 10) label='Systolic Pressure (mmHg)';
  keylegend "bp" / position=right across=1 title='Stage';
  inset "Isolated" "Systolic" "Hypertension" / position=left textattrs=graphlabeltext;
run;

1 REPLY 1
ballardw
Super User

Listing destination pretty much ignores the ODS styles.

If your looking at a graph in the Results window, that isn't listing output and is likely using your default style. Try ODS HTML style=BP; and see what you get.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 458 views
  • 0 likes
  • 2 in conversation