<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Proc template and font adjustment in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-template-and-font-adjustment/m-p/840571#M26002</link>
    <description>&lt;P&gt;How to modify the font in proc template?&lt;BR /&gt;Unable to get readable size for below figure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt; 

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=&amp;amp;bigna)";
	  scatterplot y=pref x=b / markerattrs=graphdata1(symbol=trianglefilled)
                        name='b' legendlabel="Patient 2 (N=&amp;amp;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 &amp;amp;maxhlt;  
	data  dots3    ;
		set   dots2  ;
		  where aehltn= &amp;amp;i ;    
		call symputx ('aehlt', aehlt); 
	run;

	title5 j=left "High Level Term: &amp;amp;aehlt." ;

	proc sgrender data=dots3 template=AEbyRelativeRisk;
	  dynamic _thk='0' _grid='on';
	run;

%end;   

%mend graph;
%graph; 

 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-10-25 094738.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76586i26451C0D1A72BCFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-10-25 094738.png" alt="Screenshot 2022-10-25 094738.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 14:45:32 GMT</pubDate>
    <dc:creator>Peter0123</dc:creator>
    <dc:date>2022-10-25T14:45:32Z</dc:date>
    <item>
      <title>Proc template and font adjustment</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-template-and-font-adjustment/m-p/840571#M26002</link>
      <description>&lt;P&gt;How to modify the font in proc template?&lt;BR /&gt;Unable to get readable size for below figure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt; 

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=&amp;amp;bigna)";
	  scatterplot y=pref x=b / markerattrs=graphdata1(symbol=trianglefilled)
                        name='b' legendlabel="Patient 2 (N=&amp;amp;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 &amp;amp;maxhlt;  
	data  dots3    ;
		set   dots2  ;
		  where aehltn= &amp;amp;i ;    
		call symputx ('aehlt', aehlt); 
	run;

	title5 j=left "High Level Term: &amp;amp;aehlt." ;

	proc sgrender data=dots3 template=AEbyRelativeRisk;
	  dynamic _thk='0' _grid='on';
	run;

%end;   

%mend graph;
%graph; 

 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-10-25 094738.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76586i26451C0D1A72BCFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-10-25 094738.png" alt="Screenshot 2022-10-25 094738.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 14:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-template-and-font-adjustment/m-p/840571#M26002</guid>
      <dc:creator>Peter0123</dc:creator>
      <dc:date>2022-10-25T14:45:32Z</dc:date>
    </item>
  </channel>
</rss>

