<?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 Re: Adding formats to Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486670#M126675</link>
    <description>&lt;P&gt;There may be a situation where you need to deal with the trailing blanks.&amp;nbsp; I have not been able to figure a way other than another %SYSFUNC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22435i791AD3B346206ADF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Aug 2018 13:58:33 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2018-08-14T13:58:33Z</dc:date>
    <item>
      <title>Adding formats to Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486646#M126661</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a a variable called FiscalYear and it's formatted:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;value FYF&lt;BR /&gt;1 = "FY16"&lt;BR /&gt;2 = "FY17"&lt;BR /&gt;3 = "FY18"&lt;BR /&gt;4 = "FY19"&lt;BR /&gt;5 = "Older Than FY16"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let FYMacro = 3;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the the title to display for the format:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title "Hospital Report for &amp;amp;FYMacro";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The result I get is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="systemtitle"&gt;&lt;SPAN class="systemtitle"&gt;Hospital&amp;nbsp;Report&amp;nbsp;for&amp;nbsp;3&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="systemtitle"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="systemtitle"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I want is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="systemtitle"&gt;&lt;SPAN class="systemtitle"&gt;Hospital&amp;nbsp;Report&amp;nbsp;for&amp;nbsp;FY18&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="systemtitle"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class="systemtitle"&gt;Any suggestions would be greatly appreciated! Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486646#M126661</guid>
      <dc:creator>hwangnyc</dc:creator>
      <dc:date>2018-08-14T12:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding formats to Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486647#M126662</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Hospital Report for %sysfunc(putn(&amp;amp;fymacro,fyf.))";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Aug 2018 12:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486647#M126662</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-14T12:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding formats to Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486650#M126665</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/81036"&gt;@hwangnyc&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;There are also options to use by-group processing and have individual titels created by by-group - but you haven't given us enough detail to propose such an approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below code shows an approach to achieve what you've asked for.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
  value fyf
    1 = "FY16"
    2 = "FY17"
    3 = "FY18"
    4 = "FY19"
    5 = "Older Than FY16"
  ;
run;

%let FYMacro = 3;

title "Hospital Report for %sysfunc(putn(&amp;amp;FYMacro,fyf.))";
proc print data=sashelp.class;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 13:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486650#M126665</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-08-14T13:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Adding formats to Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486670#M126675</link>
      <description>&lt;P&gt;There may be a situation where you need to deal with the trailing blanks.&amp;nbsp; I have not been able to figure a way other than another %SYSFUNC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/22435i791AD3B346206ADF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 13:58:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486670#M126675</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-08-14T13:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding formats to Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486689#M126680</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n0tvdbcgr9xc6dn14wmx9hpd6h51.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;%CMPRES&lt;/A&gt; is a bit shorter:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%cmpres(%sysfunc(putn(&amp;amp;FYMacro,fyf)))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Aug 2018 14:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-formats-to-Macro/m-p/486689#M126680</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-08-14T14:33:44Z</dc:date>
    </item>
  </channel>
</rss>

