<?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: how to make a histogram inside a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704939#M216147</link>
    <description>&lt;P&gt;If you intend to reference the data set with the DSNM macro variable then you need an &amp;amp; in front of DSNm. Since you currently are likely not referencing a data set then the variable &amp;amp;VBL is not found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of fixing the library name as you do with this code:&lt;/P&gt;
&lt;PRE&gt;proc univariate data = work.DSNm;&lt;/PRE&gt;
&lt;P&gt;it is usually&amp;nbsp; a better idea to use&lt;/P&gt;
&lt;PRE&gt;proc univariate data = &amp;amp;DSNm.;&lt;/PRE&gt;
&lt;P&gt;And then if desired you can pass the library name if needed in the macro call.&lt;/P&gt;
&lt;PRE&gt;&amp;amp;HistandStats ( DSNm = mylib.somedateset, vbl= &amp;lt;other parameters you want);
 &lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Dec 2020 04:58:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-12-10T04:58:09Z</dc:date>
    <item>
      <title>how to make a histogram inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704932#M216143</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a histogram inside of a macro that uses a parameter variable of &amp;amp;Vbl. Does anyone know how to do this? my current code is:&lt;/P&gt;&lt;P&gt;%MACRO HistandStats ( DSNm = , Vbl = , Stats = N MEAN STDDEV ,&lt;BR /&gt;Ndec = 1);&lt;/P&gt;&lt;P&gt;TITLE1 "Histogram for &amp;amp;Vbl from Data Set &amp;amp;DSNm";&lt;BR /&gt;proc univariate data = work.DSNm;&lt;BR /&gt;histogram &amp;amp;Vbl;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but this doesn't seem to work when I set DSNm and Vbl to specific values! thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 04:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704932#M216143</guid>
      <dc:creator>blakeellis18</dc:creator>
      <dc:date>2020-12-10T04:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a histogram inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704939#M216147</link>
      <description>&lt;P&gt;If you intend to reference the data set with the DSNM macro variable then you need an &amp;amp; in front of DSNm. Since you currently are likely not referencing a data set then the variable &amp;amp;VBL is not found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of fixing the library name as you do with this code:&lt;/P&gt;
&lt;PRE&gt;proc univariate data = work.DSNm;&lt;/PRE&gt;
&lt;P&gt;it is usually&amp;nbsp; a better idea to use&lt;/P&gt;
&lt;PRE&gt;proc univariate data = &amp;amp;DSNm.;&lt;/PRE&gt;
&lt;P&gt;And then if desired you can pass the library name if needed in the macro call.&lt;/P&gt;
&lt;PRE&gt;&amp;amp;HistandStats ( DSNm = mylib.somedateset, vbl= &amp;lt;other parameters you want);
 &lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 04:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704939#M216147</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-10T04:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to make a histogram inside a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704940#M216148</link>
      <description>&lt;P&gt;&lt;STRONG&gt;yes thank you! I completely missed the "&amp;amp;" in front of DSNm. and I took your advice and changed it to &amp;amp;DSNm. instead of work.&amp;amp;DSNm and it worked. Thanks again!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 05:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-make-a-histogram-inside-a-macro/m-p/704940#M216148</guid>
      <dc:creator>blakeellis18</dc:creator>
      <dc:date>2020-12-10T05:04:18Z</dc:date>
    </item>
  </channel>
</rss>

