<?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 loading multiple files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683417#M206996</link>
    <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class="" title=""&gt;I am using a loop in datastep to load files together and analyze.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="" title=""&gt;Is there any other simpler and faster way ??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test();

%let C_k_09_3 = 3;
%let C_k_09_4 = 6;
%let C_k_09_5 = 6;

%let C_k_09_3_H = %sysevalf(&amp;amp;C_k_09_3 + 2);	%let C_k_09_3_L = %sysevalf(&amp;amp;C_k_09_3 - 2);
%let C_k_09_4_H = %sysevalf(&amp;amp;C_k_09_4 + 2);	%let C_k_09_4_L = %sysevalf(&amp;amp;C_k_09_4 - 2);
%let C_k_09_5_H = %sysevalf(&amp;amp;C_k_09_5 + 2);	%let C_k_09_5_L = %sysevalf(&amp;amp;C_k_09_5 - 2);

data test;
set  
	%do i = &amp;amp;C_k_09_3_L %to  &amp;amp;C_k_09_3_H ;
		%do j = &amp;amp;C_k_09_4_L %to  &amp;amp;C_k_09_4_H ;
			%do k = &amp;amp;C_k_09_5_L %to  &amp;amp;C_k_09_5_H;

				test__&amp;amp;i&amp;amp;j&amp;amp;k


			%end;
		%end;
	%end;
;

run;

%mend test;

%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="text-wrap tlid-copy-target"&gt;
&lt;DIV class="result-shield-container tlid-copy-target" tabindex="0"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN title=""&gt;best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="" title=""&gt;thank you in advance for your help&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sat, 12 Sep 2020 09:26:44 GMT</pubDate>
    <dc:creator>makset</dc:creator>
    <dc:date>2020-09-12T09:26:44Z</dc:date>
    <item>
      <title>loading multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683417#M206996</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class="" title=""&gt;I am using a loop in datastep to load files together and analyze.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="" title=""&gt;Is there any other simpler and faster way ??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test();

%let C_k_09_3 = 3;
%let C_k_09_4 = 6;
%let C_k_09_5 = 6;

%let C_k_09_3_H = %sysevalf(&amp;amp;C_k_09_3 + 2);	%let C_k_09_3_L = %sysevalf(&amp;amp;C_k_09_3 - 2);
%let C_k_09_4_H = %sysevalf(&amp;amp;C_k_09_4 + 2);	%let C_k_09_4_L = %sysevalf(&amp;amp;C_k_09_4 - 2);
%let C_k_09_5_H = %sysevalf(&amp;amp;C_k_09_5 + 2);	%let C_k_09_5_L = %sysevalf(&amp;amp;C_k_09_5 - 2);

data test;
set  
	%do i = &amp;amp;C_k_09_3_L %to  &amp;amp;C_k_09_3_H ;
		%do j = &amp;amp;C_k_09_4_L %to  &amp;amp;C_k_09_4_H ;
			%do k = &amp;amp;C_k_09_5_L %to  &amp;amp;C_k_09_5_H;

				test__&amp;amp;i&amp;amp;j&amp;amp;k


			%end;
		%end;
	%end;
;

run;

%mend test;

%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="text-wrap tlid-copy-target"&gt;
&lt;DIV class="result-shield-container tlid-copy-target" tabindex="0"&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN title=""&gt;best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="" title=""&gt;thank you in advance for your help&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 12 Sep 2020 09:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683417#M206996</guid>
      <dc:creator>makset</dc:creator>
      <dc:date>2020-09-12T09:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: loading multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683419#M206998</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17744"&gt;@makset&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is nothing wrong with the way you use the macro to generate the set items. I cant' se that could be done simpler or more effecient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your calculation is very complicated. As there are no decimal values here, you could use %eval instead of %sysevalf and get the same. But it might be easier to specify the sets of low and high values for each position:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test();

%let ilow = 1; %let ihigh = 5;
%let jlow = 4; %let jhigh = 8;
%let klow = 4; %let khigh = 8;

data test;
set  
	%do i = &amp;amp;ilow %to &amp;amp;ihigh;
		%do j = &amp;amp;jlow %to &amp;amp;jhigh;
			%do k = &amp;amp;klow %to &amp;amp;khigh;
				test__&amp;amp;i&amp;amp;j&amp;amp;k;
			%end;
		%end;
	%end;
;
run;
%mend test;
%test;&lt;/CODE&gt;&lt;/PRE&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;</description>
      <pubDate>Sat, 12 Sep 2020 09:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683419#M206998</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2020-09-12T09:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: loading multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683421#M207000</link>
      <description>&lt;P&gt;So you have three input parameters, each specifying the center point of a loop that runs for 5 elements.&lt;/P&gt;
&lt;P&gt;I would build the list in a data step.&lt;/P&gt;
&lt;P&gt;Why?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;no extra macro is needed&lt;/LI&gt;
&lt;LI&gt;no %eval to do the calculations for the loop&lt;/LI&gt;
&lt;LI&gt;code is easier to read and think through&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let l1=3;
%let l2=6;
%let l3=6;

data _null_;
length setlist $32767;
do i = &amp;amp;l1. - 2 to &amp;amp;l1. + 2;
  do j = &amp;amp;l2. - 2 to &amp;amp;l2. + 2;
    do k = &amp;amp;l3. - 2 to &amp;amp;l3. + 2;
      setlist = catx(" ",setlist,cats("test__",i,j,k));
    end;
  end;
end;
call symputx('setlist',setlist);
run;

data test;
set &amp;amp;setlist.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Sep 2020 10:02:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683421#M207000</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-12T10:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: loading multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683426#M207004</link>
      <description>&lt;P&gt;If I, J, or K exceed 9 you will have the possibility of the SET list have the same data set listed twice. This is because concatenation &amp;amp;I&amp;amp;J&amp;amp;K has no delimiters between the resolved values, likely due to naming convention of the TEMP__ tables.&lt;/P&gt;
&lt;P&gt;Example:&lt;BR /&gt;TEMP__1111 would be listed three times in SET if the I,J,K loops were 1 to 11&lt;BR /&gt;- 11, 1, 1&lt;BR /&gt;- 1, 11, 1 &lt;BR /&gt;- 1, 1, 11&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 10:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/loading-multiple-files/m-p/683426#M207004</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-09-12T10:58:20Z</dc:date>
    </item>
  </channel>
</rss>

