How to modify the font in proc template?
Unable to get readable size for below figure.
DATA WORK.Book1;
LENGTH
AEHLT $ 36
AEHLTN 8
RR 8
LCL 8
UCL 8
A 8
B 8
PREF $ 39
REF $ 16 ;
FORMAT
AEHLT $CHAR36.
AEHLTN BEST12.
RR BEST12.
LCL BEST12.
UCL BEST12.
A BEST12.
B BEST12.
PREF $CHAR39.
REF $CHAR16. ;
INFORMAT
AEHLT $CHAR36.
AEHLTN BEST12.
RR BEST12.
LCL BEST12.
UCL BEST12.
A BEST12.
B BEST12.
PREF $CHAR39.
REF $CHAR16. ;
INFILE DATALINES4
/* DLM='7F'x */
DLM='^'
MISSOVER
DSD ;
INPUT
AEHLT : $CHAR36.
AEHLTN : BEST32.
RR : BEST32.
LCL : BEST32.
UCL : BEST32.
A : BEST32.
B : BEST32.
PREF : $CHAR39.
REF : $CHAR16. ;
DATALINES4;
Abdominal findings ^1^0^.^.^0^0.0010405827^Gastrointestinal sounds abnormal^
Acute pancreatitis^2^0^.^.^0.789892^0^Pancreatitis^Pancreatitis
Adjustment disorders^3^0^.^.^0^0.98989^Adjustment disorder with depressed mood^
Allergic conditions NEC^4^0^.^.^0^0.411^Hypersensitivity^Hypersensitivity
Anaemia deficiencies^5^0^.^.^0.578878^0.4144^Iron deficiency anaemia^
Anaemias NEC^6^2.4447^0.0878216^15.87878^0.444^0.54545450122^Anaemia^Anaemia
**bleep** and rectal signs and symptoms^7^0^.^.^0.47747^0^Anorectal discomfort^
Anxiety symptoms^8^0^.^.^0^0.87778212^Anxiety^Anxiety
Apocrine and eccrine gland disorders^9^0^.^.^0.878787^0^Cold sweat^
Apocrine and eccrine gland disorders^9^0^.^.^0.1233^0^Hyperhidrosis^Hyperhidrosis
Apocrine and eccrine gland disorders^9^0^.^.^0.87878878^0^Night sweats^
;;;;
data dots2 ;
set Book1 ;
run;
ods path reset;
ods path (prepend) work.templat(update);
/*--Create template for AE graph--*/
proc template;
define style rtf;
parent = rtf ;
/* class GraphFonts/*/
/* 'GraphValueFont' = ("Arial",12pt)*/
/* 'GraphLabelFont' = ("Arial",12pt, bold)*/
/* 'GraphDataFont' = ("Arial",12pt, bold)*/
/* 'GraphlabelFont' = ("Arial",12pt, bold)*/
/* */
;end;
define statgraph AEbyRelativeRisk;
dynamic _thk _grid;
begingraph;
/* entrytitle '';*/
layout lattice / columns=2 rowdatarange=union columngutter=5;
/*--Row block to get common external row axes--*/
rowaxes;
rowaxis / griddisplay=_grid display=(tickvalues) tickvalueattrs=(size=5);
endrowaxes;
/*--Column headers with filled background--*/
column2headers;
layout overlay / border=true backgroundcolor=cxdfdfdf opaque=true;
/* entry "Proportion"; */
endlayout;
layout overlay / border=true backgroundcolor=cxdfdfdf opaque=true;
/* entry "Risk Difference with 0.95 CI"; */
endlayout;
endcolumn2headers;
/*--Left side cell with proportional values--*/
layout overlay / xaxisopts=(label="Percent" labelattrs=(size=8) /* linearopts= ( tickvaluelist=(0 2 4 6 8 10 12 14)) */ display=(ticks tickvalues) tickvalueattrs=(size=7) );
referenceline y=ref / lineattrs=(thickness=_thk) datatransparency=0.9;
scatterplot y=pref x=a / markerattrs=graphdata2(symbol=circlefilled)
name='a' legendlabel="Patient 1 (N=&bigna)";
scatterplot y=pref x=b / markerattrs=graphdata1(symbol=trianglefilled)
name='b' legendlabel="Patient 2 (N=&bignb)";
endlayout;
/*--Right side cell with Relative Risk values--*/
layout overlay / xaxisopts=(label='Relative Risk '
labelattrs=(size=8) tickvalueattrs=(size=7));
referenceline y=ref / lineattrs=(thickness=_thk) datatransparency=0.9;
scatterplot y=pref x=rr / xerrorlower=lcl xerrorupper=ucl
markerattrs=(symbol=circlefilled size=5);
referenceline x=0 / lineattrs=graphdatadefault(pattern=shortdash);
endlayout;
/*--Centered side bar for legend--*/
sidebar / spacefill=false;
discretelegend 'a' 'b' / border=false;
endsidebar;
endlayout;
endgraph;
end;
run;
ods graphics on / reset noborder height=5.1in width=9.3in noscale outputfmt=EMF ;
%global maxhlt;
proc sql noprint ; select max(aehltn) into: maxhlt from dots2 ; quit;
/*ods graphics / reset width=6in height=4in imagename='AEbyRelativeRisk';*/
%macro graph ;
%do i= 1 %to &maxhlt;
data dots3 ;
set dots2 ;
where aehltn= &i ;
call symputx ('aehlt', aehlt);
run;
title5 j=left "High Level Term: &aehlt." ;
proc sgrender data=dots3 template=AEbyRelativeRisk;
dynamic _thk='0' _grid='on';
run;
%end;
%mend graph;
%graph;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.