BookmarkSubscribeRSS Feed
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Hello all-
One last question-
How I request a specific lineattrs & markerattrs for a specific unit of measure so that if unit A then:
lineattrs=(pattern=solid thickness=2px color=blue)
markerattrs=(symbol=circlefilled )

Thank you again.
LB
3 REPLIES 3
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
the whole code might help:
I want to change just one unit...

proc sgplot data=BASIC_OUT_II ;
WHERE UNIT1 IN ('Adult Overall Composite', 'ICU', 'NICU','ICC','MZICU') and _type_ in (7,11) and CURRENTFY=1;


series x=Moi2 y=CRBSI_RATE /
datalabel=CRBSIgraph
lineattrs=(pattern=solid thickness=2px)
markerattrs=(symbol=circlefilled )
markers group=UNIT1
name="UNITS";
keylegend "UNITS" /
position=bottom location=outside across=5 title='UNIT:';
yaxis label='CRBSI Rate per 1000 dd' GRID VALUES = (0 TO 15 BY 2.5);
xaxis LABEL=' ' DISPLAY=(NOTICKS);
REFLINE 4.56 / TRANSPARENCY = .1 LINEATTRS=(pattern=dot thickness=3px color=green)
LABEL = ('UCSF IAP Goal:4.56') LABELLOC= INSIDE ;
run;
ODS GRAPHICS OFF;
DanH_sas
SAS Super FREQ
There is currently not a away to assign graph attributes directly to a data value; however, assuming your data is sorted by UNIT1 and Moi2, you could put those attributes in a style element that would get picked up by UNIT A. For example,

proc template;
define style styles.unitstyle;
parent=styles.listing; /* or whatever style you're using */
style GraphData1 from GraphData1 / /* The number depends on the position */
linestyle=1 /* of the unit in your list of units */
linethickness=2
contrastcolor=blue
markersymbol=circlefilled
;
run;

ods listing style=unitstyle; /* or whatever destination you're using */
DanH_sas
SAS Super FREQ
One correction to my proc template code: I missed an END;. The corected code is below:

proc template;
define style styles.unitstyle;
parent=styles.listing; /* or whatever style you're using */
style GraphData1 from GraphData1 / /* The number depends on the position */
linestyle=1 /* of the unit in your list of units */
linethickness=2
contrastcolor=blue
markersymbol=circlefilled
;
end;
run;

ods listing style=unitstyle; /* or whatever destination you're using */

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore 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
  • 2871 views
  • 0 likes
  • 2 in conversation