<?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: BASE SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590623#M15073</link>
    <description>Really Helpful for me Thank you so much all.</description>
    <pubDate>Sat, 21 Sep 2019 15:48:52 GMT</pubDate>
    <dc:creator>svasu611</dc:creator>
    <dc:date>2019-09-21T15:48:52Z</dc:date>
    <item>
      <title>BASE SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590253#M15014</link>
      <description>&lt;DIV&gt;&lt;FONT&gt;HI Team,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;why my macro not create new variable.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;data s;&lt;BR /&gt;&amp;nbsp;set sashelp.class;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&amp;nbsp;if name="Alice" then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;new=1;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;%macro a;&lt;BR /&gt;&amp;nbsp;data a;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;set sashelp.class;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&amp;nbsp;&amp;nbsp;%if name="Alice" %then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%end;&lt;BR /&gt;&amp;nbsp;run;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;%mend;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;%a;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;Thanks in Advance.&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Sep 2019 03:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590253#M15014</guid>
      <dc:creator>svasu611</dc:creator>
      <dc:date>2019-09-20T03:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: BASE SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590261#M15015</link>
      <description>&lt;P&gt;You can't substitute macro IF logic for DATA step IF logic. A macro IF can only compare values of macro variables not values held in a DATA step. A nonsensical version based on your example would be as follows. Since NAME can only be Alice, new will be 1 for all rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro a (name = );
 data a;
  set sashelp.class;
  %if &amp;amp;name=Alice %then
   %do;
    new=1;
   %end;
 run;
%mend;
%a (name = Alice);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Sep 2019 04:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590261#M15015</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-09-20T04:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: BASE SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590269#M15017</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/288329"&gt;@svasu611&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT&gt;HI Team,&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;why my macro not create new variable.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;data s;&lt;BR /&gt;&amp;nbsp;set sashelp.class;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;&amp;nbsp;if name="Alice" then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;new=1;&lt;BR /&gt;run;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;%macro a;&lt;BR /&gt;&amp;nbsp;data a;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;set sashelp.class;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;&amp;nbsp;&amp;nbsp;%if name="Alice" %then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;new=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;%end;&lt;BR /&gt;&amp;nbsp;run;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;%mend;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;%a;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT&gt;Thanks in Advance.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because you completely misunderstand what the macro processor is, what it does, and when it does it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro&amp;nbsp;&lt;STRONG&gt;pre&lt;/STRONG&gt;processor is a sophisticated&amp;nbsp;&lt;EM&gt;text&lt;/EM&gt; generation engine that modifies&amp;nbsp;&lt;EM&gt;code&lt;/EM&gt; before it is fed to the SAS interpreter.&lt;/P&gt;
&lt;P&gt;It only sees text, and the texts&lt;/P&gt;
&lt;PRE&gt;name&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;"Alice"&lt;/PRE&gt;
&lt;P&gt;(note the presence and non-presence of quotes, they are part of the&amp;nbsp;&lt;EM&gt;text&lt;/EM&gt;)&lt;/P&gt;
&lt;P&gt;are not the same, so the code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;new=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is not created by the macro, and can't be executed by the SAS interpreter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are a beginner, I strongly suggest you don't dabble with macros for the time being, and instead really learn how to work with the Base SAS code. Since macros generate dynamic code, it is essential to know what you create and what that will do in order to make proper use of the macro language.&lt;/P&gt;
&lt;P&gt;Simple text replacement through macro variables is another thing, safe for beginners.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 05:52:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590269#M15017</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-20T05:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: BASE SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590623#M15073</link>
      <description>Really Helpful for me Thank you so much all.</description>
      <pubDate>Sat, 21 Sep 2019 15:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/BASE-SAS/m-p/590623#M15073</guid>
      <dc:creator>svasu611</dc:creator>
      <dc:date>2019-09-21T15:48:52Z</dc:date>
    </item>
  </channel>
</rss>

