<?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 Read In Using Loop in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729389#M80338</link>
    <description>&lt;P&gt;I am wondering if there is a more efficient way to append a bunch of data sets during read in. Fortunately, all the data sets I am working with follow the same naming convention and only differ in a single number that increments each year. I have been doing the below, but since is this something I will simply have to add to each year, am wondering if there is a way to use a macro (indicating the most recent year) and a loop to make this more efficient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data app_data;
	  set 	ds2015
			ds2016
			ds2017
			ds2018
			ds2019
			ds2020;

        *Other stuff happens;
run;

&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Mar 2021 14:17:03 GMT</pubDate>
    <dc:creator>raivester</dc:creator>
    <dc:date>2021-03-26T14:17:03Z</dc:date>
    <item>
      <title>Read In Using Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729389#M80338</link>
      <description>&lt;P&gt;I am wondering if there is a more efficient way to append a bunch of data sets during read in. Fortunately, all the data sets I am working with follow the same naming convention and only differ in a single number that increments each year. I have been doing the below, but since is this something I will simply have to add to each year, am wondering if there is a way to use a macro (indicating the most recent year) and a loop to make this more efficient.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data app_data;
	  set 	ds2015
			ds2016
			ds2017
			ds2018
			ds2019
			ds2020;

        *Other stuff happens;
run;

&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729389#M80338</guid>
      <dc:creator>raivester</dc:creator>
      <dc:date>2021-03-26T14:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read In Using Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729397#M80339</link>
      <description>&lt;P&gt;Since your datasets are using nice sequential numeric suffixes you can use a dataset list.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data app_data;
  set ds2015-ds2020;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729397#M80339</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-26T14:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Read In Using Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729421#M80340</link>
      <description>&lt;P&gt;Depending on your situation, this maybe useful.&amp;nbsp; A colon is used as a wildcard for datasets.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data app_data;
  set ds: ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This will select &lt;EM&gt;&lt;U&gt;ALL&lt;/U&gt; &lt;/EM&gt;datasets in WORK with the "ds" prefix, mind you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 15:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729421#M80340</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-26T15:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Read In Using Loop</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729619#M80345</link>
      <description>Hi:&lt;BR /&gt;  If "other stuff happens then the DATA step is the best way to append. If all you needed to do was the append and none of the other stuff, then you could use PROC APPEND.&lt;BR /&gt;Cynthia</description>
      <pubDate>Sun, 28 Mar 2021 12:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Read-In-Using-Loop/m-p/729619#M80345</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-03-28T12:31:25Z</dc:date>
    </item>
  </channel>
</rss>

