<?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: SAS macro in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579285#M13437</link>
    <description>&lt;P&gt;Writing a macro&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymac(ds1=,ds2=);
data &amp;amp;ds1.;
set &amp;amp;ds2.;
run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so that you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mymac(ds1=abc,ds2=xyz)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;just to automate&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
set xyz;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is only a waste of time. And it makes programs less maintainable, because now everyone (and that includes your future YOU!) has to look for the macro code in another place, instead of seeing what will happen right there on the spot.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2019 07:11:18 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-08-06T07:11:18Z</dc:date>
    <item>
      <title>SAS macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579270#M13434</link>
      <description>&lt;P&gt;Hi, I want to create a SAS macro that will be used to create dataset names for each dataset.&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made it earlier but don't remember it. It was something like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro test ( dataset1= , dataset 2= );&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;% test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data &amp;amp;dataset1. ;&lt;/P&gt;&lt;P&gt;Set abc;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data &amp;amp;dataset2.;&lt;/P&gt;&lt;P&gt;Set xtz;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%test;&lt;/P&gt;&lt;P&gt;%dataset1=data_1:&lt;/P&gt;&lt;P&gt;%dataset2= data_2;&lt;/P&gt;&lt;P&gt;%mend test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is the above code correct??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 04:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579270#M13434</guid>
      <dc:creator>saipriya92</dc:creator>
      <dc:date>2019-08-06T04:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579273#M13435</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235904"&gt;@saipriya92&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so this coding will not even run, but I guess that is why you are here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The question is what do you want? Create dataset names for each dataset? What rules should the naming convention follow, etc.?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post an example of your input and your expected output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind Regards&lt;/P&gt;
&lt;P&gt;Criptic&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 05:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579273#M13435</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2019-08-06T05:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579285#M13437</link>
      <description>&lt;P&gt;Writing a macro&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mymac(ds1=,ds2=);
data &amp;amp;ds1.;
set &amp;amp;ds2.;
run;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so that you can use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%mymac(ds1=abc,ds2=xyz)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;just to automate&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
set xyz;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is only a waste of time. And it makes programs less maintainable, because now everyone (and that includes your future YOU!) has to look for the macro code in another place, instead of seeing what will happen right there on the spot.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2019 07:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-macro/m-p/579285#M13437</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-06T07:11:18Z</dc:date>
    </item>
  </channel>
</rss>

