<?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: why i dont get the new variables in macro applications in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530431#M145058</link>
    <description>&lt;P&gt;Maybe&lt;/P&gt;
&lt;P&gt;%macro copy1;&lt;BR /&gt;data ex1 ;&lt;BR /&gt;set sashelp.class ;&lt;BR /&gt;%do i=1 %to 5 ;&lt;BR /&gt;&amp;amp;&amp;amp;ne&amp;amp;i.=&amp;amp;&amp;amp;n&amp;amp;i.;&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 27 Jan 2019 06:50:19 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2019-01-27T06:50:19Z</dc:date>
    <item>
      <title>why i dont get the new variables in macro applications</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530425#M145053</link>
      <description>&lt;P&gt;proc contents data=sashelp.class noprint out=s(keep=name type) ;run;&lt;BR /&gt;proc sort data=s;by type ;run;&lt;BR /&gt;proc sql ;&lt;BR /&gt;select strip(name)||'1',name into:ne1-:ne5,:n1-:n5 from s ;&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;n1 &amp;amp;n2 &amp;amp;n3 &amp;amp;n4 &amp;amp;n5 &amp;amp;ne1 &amp;amp;ne2 &amp;amp;ne3 &amp;amp;ne4 &amp;amp;ne5;&lt;BR /&gt;%macro copy1;&lt;BR /&gt;%do i=1 %to 5 ;&lt;BR /&gt;data ex1 ;&lt;BR /&gt;set sashelp.class ;&lt;BR /&gt;&amp;amp;&amp;amp;ne&amp;amp;i.=&amp;amp;&amp;amp;n&amp;amp;i.;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;%copy1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to create 5 new variables like age1,name1,sex1,height1,weight1 so&amp;nbsp; i wrote one applications but i am getting only one variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the issue in that application&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jan 2019 06:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530425#M145053</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-01-27T06:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: why i dont get the new variables in macro applications</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530428#M145055</link>
      <description>You create table EX1 over and over.</description>
      <pubDate>Sun, 27 Jan 2019 06:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530428#M145055</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-27T06:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: why i dont get the new variables in macro applications</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530429#M145056</link>
      <description>then how to rectify that issue can u help me?&lt;BR /&gt;</description>
      <pubDate>Sun, 27 Jan 2019 06:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530429#M145056</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-01-27T06:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: why i dont get the new variables in macro applications</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530431#M145058</link>
      <description>&lt;P&gt;Maybe&lt;/P&gt;
&lt;P&gt;%macro copy1;&lt;BR /&gt;data ex1 ;&lt;BR /&gt;set sashelp.class ;&lt;BR /&gt;%do i=1 %to 5 ;&lt;BR /&gt;&amp;amp;&amp;amp;ne&amp;amp;i.=&amp;amp;&amp;amp;n&amp;amp;i.;&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;run;&lt;BR /&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jan 2019 06:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530431#M145058</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-27T06:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: why i dont get the new variables in macro applications</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530564#M145115</link>
      <description>&lt;P&gt;You already got a good answer from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;, but it is much simpler to do this using just SQL and no macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select cats(name,'1=',name) into :doit separated by ';' from dictionary.columns
  where libname='SASHELP' and memname='CLASS';
quit;

data ex1;
  set sashelp.class;
  &amp;amp;doit;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, if you are trying to learn macro programming, the other way is a valid exercise. But one of the important things to know about macro language is when NOT to use it.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 09:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530564#M145115</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-01-28T09:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: why i dont get the new variables in macro applications</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530765#M145165</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76464"&gt;@s_lassen&lt;/a&gt;&amp;nbsp;You still use the "proc sql creates macro variable" method.&lt;/P&gt;
&lt;P&gt;But yes, I agree, it's better to build the whole expression as one macro variable.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2019 20:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-i-dont-get-the-new-variables-in-macro-applications/m-p/530765#M145165</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-01-28T20:33:30Z</dc:date>
    </item>
  </channel>
</rss>

