<?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: %put to print macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79199#M256498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1343735893626701" jivemacro_uid="_1343735893626701"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Hi...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nothing wrong with your code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are trying to print the local macro variable values in outside of the macro.it can not be possible.&lt;/P&gt;&lt;P&gt;Use the put statement with in the Macro,then you can get the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sanjeev.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jul 2012 11:51:25 GMT</pubDate>
    <dc:creator>kuridisanjeev</dc:creator>
    <dc:date>2012-07-31T11:51:25Z</dc:date>
    <item>
      <title>%put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79196#M256495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp; The following macro works good but when I tried to print the macro variables using %put statement gives not found error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;But when I am not using proc sql in the cnts macro and into :tab or :tba , the put statement working fine.&amp;nbsp; why is that error pls somebody help&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;me with it. Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%macro cnts(dis=, ind=, ovr=, tt=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct &amp;amp;dis.) format=2. into :&amp;amp;ovr.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;amp;ind.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where trt IN(&amp;amp;tt.); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%mend cnts;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt;"&gt;%cnts(dis=patient, ind=ae, ovr=tab, tt='AB');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;%cnts(dis=patient, ind=ae, ovr=tba, tt='BA');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%put " &amp;amp;tab. &amp;amp;tba.";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;getting the following error msg&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference TAB not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference TBA not resolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 05:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79196#M256495</guid>
      <dc:creator>mimi</dc:creator>
      <dc:date>2012-07-31T05:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79197#M256496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this...not tested...&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;%macro cnts(dis=, ind=, ovr=, tt=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;%global tab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct &amp;amp;dis.) format=2. into :&amp;amp;ovr. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;amp;ind.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where trt IN(&amp;amp;tt.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;%mend cnts;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;%put &amp;amp;tab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Shiva&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 06:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79197#M256496</guid>
      <dc:creator>shivas</dc:creator>
      <dc:date>2012-07-31T06:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79198#M256497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consider using code like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro cnts(dis=, ind=, ovr=, tt=);&lt;BR /&gt;&amp;nbsp; proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct &amp;amp;dis.) format=2. into :&amp;amp;ovr.&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;amp;ind.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where trt IN(&amp;amp;tt.); &lt;BR /&gt;&amp;nbsp; quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %put %bquote(&amp;amp;ovr) has value %bquote(&amp;amp;&amp;amp;&amp;amp;ovr);&lt;/P&gt;&lt;P&gt;%mend cnts;&lt;/P&gt;&lt;P&gt;%cnts(dis=patient, ind=ae, ovr=tab, tt='AB');&lt;BR /&gt;%cnts(dis=patient, ind=ae, ovr=tba, tt='BA');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 08:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79198#M256497</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-07-31T08:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79199#M256498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1343735893626701" jivemacro_uid="_1343735893626701"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Hi...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nothing wrong with your code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you are trying to print the local macro variable values in outside of the macro.it can not be possible.&lt;/P&gt;&lt;P&gt;Use the put statement with in the Macro,then you can get the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sanjeev.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 11:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79199#M256498</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2012-07-31T11:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79200#M256499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per above&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please use below code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro cnts(dis=, ind=, ovr=, tt=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct &amp;amp;dis.) format=2. into :&amp;amp;ovr. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;amp;ind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where trt IN(&amp;amp;tt.);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%put " &amp;amp;&amp;amp;&amp;amp;ovr.";&lt;/P&gt;&lt;P&gt;%mend cnts;&lt;/P&gt;&lt;P&gt;%cnts(dis=patient, ind=ae, ovr=tab, tt='AB');&lt;/P&gt;&lt;P&gt;%cnts(dis=patient, ind=ae, ovr=tba, tt='BA');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 12:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79200#M256499</guid>
      <dc:creator>yaswanthj</dc:creator>
      <dc:date>2012-07-31T12:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79201#M256500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can try making the argument passed to the macro function a global macro variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;%macro cnts(dis=, ind=, ovr=, tt=);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %global &amp;amp;ovr; /* make available outside of macro function */&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct &amp;amp;dis.) format=2. into :&amp;amp;ovr. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt; font-style: inherit;"&gt;from &amp;amp;ind.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where trt IN(&amp;amp;tt.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;%mend cnts;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;%cnts(dis=patient, ind=ae, ovr=tab, tt='AB');&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;%cnts(dis=patient, ind=ae, ovr=tba, tt='BA');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-size: 10pt; font-family: 'courier new', courier;"&gt;%put " &amp;amp;tab. &amp;amp;tba.";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="font-family: 'courier new', courier;"&gt;%put&lt;/SPAN&gt; statement does not require quotes to print the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 12:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79201#M256500</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2012-07-31T12:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79202#M256501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if you really ran the program that you posted, you are trying to %PUT macro variables that don't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no macro variable named &amp;amp;TAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no macro variable named &amp;amp;TBA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of the comments about global vs. local would apply if you try to examine &amp;amp;OVR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 16:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79202#M256501</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-07-31T16:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79203#M256502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Astounding&lt;/P&gt;&lt;P&gt;I believe you've missed the "select into :&lt;STRONG&gt;&amp;amp;ovr&lt;/STRONG&gt;" bit in the macro. Macrovars &amp;amp;TAB and &amp;amp;TBA get created when the macro executes (values passed to OVR when calling the macro). It's about scope of the macro vars like others already said.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 22:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79203#M256502</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2012-07-31T22:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79204#M256503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course you 'could' simply move to put statement into the macro.&amp;nbsp; Does the following do what you are trying to accomplish?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro cnts(dis=, ind=, ovr=, tt=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(distinct &amp;amp;dis.) format=2. into :&amp;amp;ovr. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &amp;amp;ind.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where sex IN(&amp;amp;tt.);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%put &amp;amp;&amp;amp;&amp;amp;ovr.;&lt;/P&gt;&lt;P&gt;%mend cnts;&lt;/P&gt;&lt;P&gt;%cnts(dis=age, ind=sashelp.class, ovr=tab, tt='M')&lt;/P&gt;&lt;P&gt;%cnts(dis=age, ind=sashelp.class, ovr=tba, tt='F')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 22:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79204#M256503</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-07-31T22:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: %put to print macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79205#M256504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for the answer.&amp;nbsp;&amp;nbsp; with in cnt macro&amp;nbsp; Iwas able to print. I needed those variable to be stored as global . I needed those vars in the last step.&lt;/P&gt;&lt;P&gt;I just needed to check if the vars are storing the correct value.&amp;nbsp; %global &amp;amp;ovr. worked fine for me .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 03:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-to-print-macro-variable/m-p/79205#M256504</guid>
      <dc:creator>mimi</dc:creator>
      <dc:date>2012-08-01T03:47:55Z</dc:date>
    </item>
  </channel>
</rss>

