<?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: macro that won't run in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705104#M26233</link>
    <description>&lt;P&gt;I think there is too much information being compiled in different statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;"proc sgplot data = work.&amp;amp;DSNm;"&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;"proc sgplot data = &amp;amp;DSNm;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;DSNm is already going to specify a data set, so adding work. to it will mess things up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"histogram &amp;amp;Vbl/N MEAN STDDEV;" is a mouthful of a histogram. A basic histogram shows one variable at a time.&lt;/P&gt;&lt;P&gt;Instead...&lt;/P&gt;&lt;P&gt;"histogram &amp;amp;Vbl;" should be sufficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2020 15:59:18 GMT</pubDate>
    <dc:creator>kbauphealth20</dc:creator>
    <dc:date>2020-12-10T15:59:18Z</dc:date>
    <item>
      <title>macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704956#M26220</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a newer SAS user and am working on a project that requires me to create macro that creates a histogram with a variety of macros inside. I have created the following code, but although I get no errors or warnings in my log, I get no results. Can anyone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks so much.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my code:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO mymacro ( DSNm = , Vbl = , Stats = N MEAN STDDEV ,&lt;BR /&gt;Ndec = 1);&lt;BR /&gt;TITLE1 "title1";&lt;BR /&gt;proc sgplot data = work.&amp;amp;DSNm;&lt;BR /&gt;histogram &amp;amp;Vbl/N MEAN STDDEV;&lt;BR /&gt;run;&lt;BR /&gt;%MEND title2;&lt;/P&gt;&lt;P&gt;%( DSNm = , Vbl = , Stats = N MEAN STDDEV , Ndec = 1);&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704956#M26220</guid>
      <dc:creator>rhaley1821</dc:creator>
      <dc:date>2020-12-10T15:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704958#M26221</link>
      <description>&lt;P&gt;my goal is to produce a histogram that looks like this:&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-12-09 at 11.23.21 PM.png" style="width: 908px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52496i87897902FD954E9F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-12-09 at 11.23.21 PM.png" alt="Screen Shot 2020-12-09 at 11.23.21 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 06:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704958#M26221</guid>
      <dc:creator>rhaley1821</dc:creator>
      <dc:date>2020-12-10T06:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704959#M26222</link>
      <description>&lt;P&gt;The first thing you need to do: get the code to work correctly&amp;nbsp;&lt;EM&gt;without&lt;/EM&gt; any macro coding.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 06:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704959#M26222</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-10T06:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704961#M26223</link>
      <description>&lt;P&gt;Here is one possible problem. Add spaces like below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;histogram &amp;amp;Vbl / N MEAN STDDEV;  * Add spaces;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 07:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704961#M26223</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-12-10T07:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704962#M26224</link>
      <description>&lt;P&gt;I got it all running, thanks for the feedback!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/704962#M26224</guid>
      <dc:creator>rhaley1821</dc:creator>
      <dc:date>2020-12-10T15:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705100#M26232</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350163"&gt;@rhaley1821&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am a newer SAS user and am working on a project that requires me to create macro that creates a histogram with a variety of macros inside. I have created the following code, but although I get no errors or warnings in my log, I get no results. Can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks so much.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;my code:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%MACRO mymacro ( DSNm = , Vbl = , Stats = N MEAN STDDEV ,&lt;BR /&gt;Ndec = 1);&lt;BR /&gt;TITLE1 "title1";&lt;BR /&gt;proc sgplot data = work.&amp;amp;DSNm;&lt;BR /&gt;histogram &amp;amp;Vbl/N MEAN STDDEV;&lt;BR /&gt;run;&lt;BR /&gt;%MEND title2;&lt;/P&gt;
&lt;P&gt;%( DSNm = , Vbl = , Stats = N MEAN STDDEV , Ndec = 1);&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The code you show does not call the macro at all and I would expect you to get a number of errors from the statement:&lt;/P&gt;
&lt;PRE&gt;%( DSNm = , Vbl = , Stats = N MEAN STDDEV , Ndec = 1);&lt;/PRE&gt;
&lt;P&gt;Best practice when having any question about the results, or lack of results, is to copy the submitted code from the LOG and paste the copied text into a text box opened on the forum with the &amp;lt;/&amp;gt; icon. Include the Code, notes, messages and errors for the section in doubt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you actually properly called the macro using&lt;/P&gt;
&lt;PRE&gt;%mymacro( DSNm = , Vbl = , Stats = N MEAN STDDEV , Ndec = 1);&lt;/PRE&gt;
&lt;P&gt;Then you did not provide a data set name or variable so the code created by this line&lt;/P&gt;
&lt;PRE&gt;proc sgplot data = work.&amp;amp;DSNm;&lt;/PRE&gt;
&lt;P&gt;would resolve to:&lt;/P&gt;
&lt;PRE&gt;proc sgplot data = work. ;&lt;/PRE&gt;
&lt;P&gt;with all sorts of "what data set to use" results.&lt;/P&gt;
&lt;P&gt;The line&lt;/P&gt;
&lt;PRE&gt;histogram &amp;amp;Vbl/N MEAN STDDEV;&lt;/PRE&gt;
&lt;P&gt;Would resolve to&lt;/P&gt;
&lt;PRE&gt;histogram    /N MEAN STDDEV;&lt;/PRE&gt;
&lt;P&gt;which if there were a data set available would plot ALL numeric variables.&lt;/P&gt;
&lt;P&gt;The Parameter values are placed in the CODE where they macro variable names&amp;nbsp; are used. If you don't provide a value then nothing appears in the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705100#M26232</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-10T15:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705104#M26233</link>
      <description>&lt;P&gt;I think there is too much information being compiled in different statements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;"proc sgplot data = work.&amp;amp;DSNm;"&lt;/P&gt;&lt;P&gt;should be&lt;/P&gt;&lt;P&gt;"proc sgplot data = &amp;amp;DSNm;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;DSNm is already going to specify a data set, so adding work. to it will mess things up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"histogram &amp;amp;Vbl/N MEAN STDDEV;" is a mouthful of a histogram. A basic histogram shows one variable at a time.&lt;/P&gt;&lt;P&gt;Instead...&lt;/P&gt;&lt;P&gt;"histogram &amp;amp;Vbl;" should be sufficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705104#M26233</guid>
      <dc:creator>kbauphealth20</dc:creator>
      <dc:date>2020-12-10T15:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: macro that won't run</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705468#M26251</link>
      <description>&lt;P&gt;Don't forget that even in a Macro you need to close off your titles and your subtitles. And you ask SAS to mend title 2 but Mend wouldn't apply to a regular title but to the macro name (i.e. MyMacro)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO mymacro ( DSNm = , Vbl = , Stats = N MEAN STDDEV ,&lt;BR /&gt;Ndec = 1);&lt;BR /&gt;TITLE1 "title1";&lt;BR /&gt;proc sgplot data = work.&amp;amp;DSNm;&lt;BR /&gt;histogram &amp;amp;Vbl/N MEAN STDDEV;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;title;&lt;/STRONG&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TITLE2 "Title2"&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DATA_STEP_HERE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Title;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%MEND Mymacro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2020 00:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-that-won-t-run/m-p/705468#M26251</guid>
      <dc:creator>Deanna_Payne</dc:creator>
      <dc:date>2020-12-13T00:22:52Z</dc:date>
    </item>
  </channel>
</rss>

