<?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: Please help find why I cannot call this Macro  m105p02.sas  ! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961934#M374971</link>
    <description>&lt;P&gt;Perhaps you re-typed some of this when making your post instead of copying the actual code?&amp;nbsp; That might explain some of the obvious typos like missing &amp;amp; when referencing the SYSLIBRC macro variable and the missing numeric suffix on the target macro variable name in the INTO clause of the SQL query.&amp;nbsp; And also perhaps why the libref defined to point at the XLSX file is not the one used later when querying the data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best path forward is to start over.&amp;nbsp; Show working code you want to run that does not use any macros or reference any macro variables.&amp;nbsp; Show it for at least 2 different basin values so we can see what part of the code the macro needs to modify.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Mar 2025 21:50:52 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-03-14T21:50:52Z</dc:date>
    <item>
      <title>Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961918#M374964</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%Macro BasinXLS;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;libname storm xlsx "&amp;amp;path/BasinStorms.xlsx";&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;%if SYSLIBRC ne 0&amp;nbsp; %then %do;&lt;/DIV&gt;&lt;DIV&gt;%put ERROR:Terminate Macro Execution;&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%else %do;&lt;/DIV&gt;&lt;DIV&gt;Proc SQL noprint;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Select Distinct Basin,&amp;nbsp; compress(BasinName)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; into :Basin1-, :BasinName-&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; From mc1.storm_basin_codes;&amp;nbsp; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; quit;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; %do i=1&amp;nbsp; %to &amp;amp;sqlobs;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Title "Group: &amp;amp;&amp;amp;Basin&amp;amp;i ";&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;data=storm.&amp;amp;&amp;amp;basinname&amp;amp;i.._Storms;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;set mc1.storm_basin_codes;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;where Basin=&amp;amp;&amp;amp;Basin&amp;amp;i;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;end;&lt;/DIV&gt;&lt;DIV&gt;%mend BasinXLS;&lt;/DIV&gt;&lt;DIV&gt;libname storm clear;&lt;/DIV&gt;&lt;DIV&gt;options mprint mlogic;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;%BasinXLS&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 17:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961918#M374964</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-03-14T17:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961919#M374965</link>
      <description>&lt;P&gt;Please post the complete log by copy/pasting the text into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that this condition&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if SYSLIBRC ne 0  %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;can never be true, as the&amp;nbsp;&lt;U&gt;text&lt;/U&gt; &lt;STRONG&gt;SYSLIBRC&lt;/STRONG&gt; is obviously not equal to the&amp;nbsp;&lt;U&gt;text&lt;/U&gt; &lt;STRONG&gt;0&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961919#M374965</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-03-14T18:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961922#M374968</link>
      <description>&lt;P&gt;Taking a guess&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data=storm.&amp;amp;&amp;amp;basinname&amp;amp;i.._Storms;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data=storm.&amp;amp;&amp;amp;basinname&amp;amp;i..._Storms;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with three dots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But really, don't make us guess, show us the log whenever you get errors, not just the errors in the log, we need to see the entire log for the macro. (And don't wait until we ask for the log either)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The underlying idea of your macro, to split a data set into smaller pieces, is something that we advise against in most cases. If you leave the data set as one big data set, you can access the parts that you want using a WHERE statement, or perform analyses using a BY statement. So, in most cases, do not split a large data set into many smaller data sets.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 20:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961922#M374968</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-03-14T20:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961923#M374969</link>
      <description>&lt;P&gt;A couple of good starting points ...&lt;/P&gt;
&lt;P&gt;As others have pointed out, we don't know what the log says, so we are only guessing ...&lt;/P&gt;
&lt;P&gt;This into: phrase looks incorrect:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;into :Basin1-, :BasinName-&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It should likely be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;into :Basin1-, :BasinName1-&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And later when using the macro variables, are the basins actually numbers, or are they character strings?&amp;nbsp; For numbers, your code is correct:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where Basin=&amp;amp;&amp;amp;Basin&amp;amp;i;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But for character strings you would need to add doublequotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where Basin="&amp;amp;&amp;amp;Basin&amp;amp;i";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 19:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961923#M374969</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2025-03-14T19:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961934#M374971</link>
      <description>&lt;P&gt;Perhaps you re-typed some of this when making your post instead of copying the actual code?&amp;nbsp; That might explain some of the obvious typos like missing &amp;amp; when referencing the SYSLIBRC macro variable and the missing numeric suffix on the target macro variable name in the INTO clause of the SQL query.&amp;nbsp; And also perhaps why the libref defined to point at the XLSX file is not the one used later when querying the data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best path forward is to start over.&amp;nbsp; Show working code you want to run that does not use any macros or reference any macro variables.&amp;nbsp; Show it for at least 2 different basin values so we can see what part of the code the macro needs to modify.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 21:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961934#M374971</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-14T21:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961979#M374994</link>
      <description>Thank you</description>
      <pubDate>Sun, 16 Mar 2025 21:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961979#M374994</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-03-16T21:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961980#M374995</link>
      <description>thank you  careless errors&lt;BR /&gt;</description>
      <pubDate>Sun, 16 Mar 2025 21:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961980#M374995</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-03-16T21:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Please help find why I cannot call this Macro  m105p02.sas  !</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961981#M374996</link>
      <description>Ok thank you that makes sense</description>
      <pubDate>Sun, 16 Mar 2025 21:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Please-help-find-why-I-cannot-call-this-Macro-m105p02-sas/m-p/961981#M374996</guid>
      <dc:creator>hmlong25</dc:creator>
      <dc:date>2025-03-16T21:48:36Z</dc:date>
    </item>
  </channel>
</rss>

