<?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: Loop Over Multiple Variables, with Multiple Outputs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/533712#M146355</link>
    <description>&lt;P&gt;Thanks for the response.&amp;nbsp; However, there are hundreds of lines of data manipulations that I perform on each variable, so using call execute gets very messy very quickly. Do you have any other suggestions?&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2019 20:03:41 GMT</pubDate>
    <dc:creator>jjb123</dc:creator>
    <dc:date>2019-02-07T20:03:41Z</dc:date>
    <item>
      <title>Loop Over Multiple Variables, with Multiple Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/532855#M146052</link>
      <description>&lt;P&gt;This is probably a question that has been asked many times and answered, but I'm not finding the info I want.&amp;nbsp; I want to do something like the following and would love some advice (or even links to the question being answered).&amp;nbsp; I basically want to be able to do something like this while being able to just list multiple variables at the top (like %let variable = x, y, z, etc.).&amp;nbsp; So I want it to be able to loop through multiple variables and perform the same procedures and give the different outputs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let variable = x;

/*then do data manipulations, etc*/

proc export data = xyz outfile = "C:\Users\person\Desktop\'&amp;amp;variable'.dta" replace;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 06:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/532855#M146052</guid>
      <dc:creator>jjb123</dc:creator>
      <dc:date>2019-02-05T06:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Over Multiple Variables, with Multiple Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/532858#M146054</link>
      <description>&lt;P&gt;You can do something along these lines&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data callstack;
   length string $500;
   do var='x', 'y', 'z';
   string=compbl(cats(
      "
      proc export data = xyz outfile = 'C:\Users\person\Desktop\", var, ".dta' replace;
      run;
      "
      ));
   output;
   call execute(string);
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 07:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/532858#M146054</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-02-05T07:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Over Multiple Variables, with Multiple Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/533712#M146355</link>
      <description>&lt;P&gt;Thanks for the response.&amp;nbsp; However, there are hundreds of lines of data manipulations that I perform on each variable, so using call execute gets very messy very quickly. Do you have any other suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 20:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/533712#M146355</guid>
      <dc:creator>jjb123</dc:creator>
      <dc:date>2019-02-07T20:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Loop Over Multiple Variables, with Multiple Outputs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/533715#M146356</link>
      <description>&lt;P&gt;Then you need a macro with nested %DO loops for the multiple variables. Since you have not provided any more details, there's really not much detail I can provide back to you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 20:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-Over-Multiple-Variables-with-Multiple-Outputs/m-p/533715#M146356</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-07T20:08:14Z</dc:date>
    </item>
  </channel>
</rss>

