BookmarkSubscribeRSS Feed
Peter0123
Fluorite | Level 6

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; 

 

Screenshot 2022-10-25 094738.png

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 0 replies
  • 504 views
  • 0 likes
  • 1 in conversation