<?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: Errors in a macro in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/703088#M37796</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;A good rule of thumb is to get your program working without macros first, and then try to convert it to a macro.&amp;nbsp; It's too difficult for a beginner to debug if you have to figure out whether your error comes from SAS language or macro language.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is so important, I am going to repeat it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"A good rule of thumb is to get your program working without macros first, and then try to convert it to a macro.&amp;nbsp; It's too difficult for a beginner to debug if you have to figure out whether your error comes from SAS language or macro language."&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you can't get the code to work without macros and without macro variables, then it will never work when you use macros and macro variables.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 13:05:36 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-12-02T13:05:36Z</dc:date>
    <item>
      <title>Errors in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/702953#M37785</link>
      <description>&lt;P&gt;I am looking to create a macro that could show me statistics for new cases when I enter in the month and the country but it doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data mylib_d3.covid_data;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%MACRO proc_univariate_means_print(data,var1);&lt;BR /&gt;&lt;BR /&gt;title ---Résumé statistiques_1---;&lt;BR /&gt;PROC UNIVARIATE data=&amp;amp;data;&lt;BR /&gt;CLASS &amp;amp;mois &amp;amp;pays&lt;BR /&gt;VAR &amp;amp;var1 ;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;title ---Résumé statistiques_2---;&lt;BR /&gt;PROC MEANS data=&amp;amp;data mean min max;&lt;BR /&gt;VAR &amp;amp;var1;&lt;BR /&gt;BY &amp;amp;mois &amp;amp;pays&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;title --- Afficher les observations ---;&lt;BR /&gt;PROC PRINT data=&amp;amp;data;&lt;BR /&gt;VAR &amp;amp;var1;&lt;BR /&gt;RUN;&lt;BR /&gt;%MEND;&lt;BR /&gt;%LET mylist=nouveaux_cas mois pays&lt;BR /&gt;%proc_univariate_means_print(mylib_d3.covid_data, &amp;amp;mylist);&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 03:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/702953#M37785</guid>
      <dc:creator>Feksan</dc:creator>
      <dc:date>2020-12-02T03:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Errors in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/702956#M37786</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350608"&gt;@Feksan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am looking to create a macro that could show me statistics for new cases when I enter in the month and the country but it doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mylib_d3.covid_data;&lt;BR /&gt;run;&lt;BR /&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If your program really does start with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mylib_d3.covid_data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then you will have overwritten mylib_d3.covid_data with an empty data set.&amp;nbsp; I believe your log will say:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: The data set MYLIB_D3.COVID_DATA has 1 observations and 0 variables.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Even if the syntax of the rest of your code is correct, you will see no data reports.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More generally&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;SPAN style="font-family: inherit; font-size: 16px;"&gt;but it doesn't work.&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;provides us with no information to diagnose or prescribe.&amp;nbsp; Please show the log, tell us what you expected to see, and what you did see.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Help us help you.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 03:24:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/702956#M37786</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-12-02T03:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Errors in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/702989#M37791</link>
      <description>&lt;P&gt;Congratulations, with this step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mylib_d3.covid_data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you have successfully destroyed your source data. The dataset will now contain 1 observation and 0 variables.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 07:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/702989#M37791</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-02T07:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Errors in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/703087#M37795</link>
      <description>&lt;P&gt;In addition to destroying your data, this program contains basic syntax errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A BY statement must end with a semicolon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A CLASS statement must end with a semicolon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A good rule of thumb is to get your program working without macros first, and then try to convert it to a macro.&amp;nbsp; It's too difficult for a beginner to debug if you have to figure out whether your error comes from SAS language or macro language.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 12:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/703087#M37795</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2020-12-02T12:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Errors in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/703088#M37796</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;A good rule of thumb is to get your program working without macros first, and then try to convert it to a macro.&amp;nbsp; It's too difficult for a beginner to debug if you have to figure out whether your error comes from SAS language or macro language.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is so important, I am going to repeat it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"A good rule of thumb is to get your program working without macros first, and then try to convert it to a macro.&amp;nbsp; It's too difficult for a beginner to debug if you have to figure out whether your error comes from SAS language or macro language."&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you can't get the code to work without macros and without macro variables, then it will never work when you use macros and macro variables.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 13:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Errors-in-a-macro/m-p/703088#M37796</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-02T13:05:36Z</dc:date>
    </item>
  </channel>
</rss>

