<?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: Read in files from list in other file dynamically in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816756#M322411</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Same &lt;A href="https://stackoverflow.com/questions/72522500/load-datasets-from-strings-in-other-file-in-a-loop" target="_self"&gt;clarifications required as on SO&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Set them into one data set?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; Individual one each?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; I'm assuming you don't want them all called X? Show what the final code should look like please.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jun 2022 20:37:23 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-06-06T20:37:23Z</dc:date>
    <item>
      <title>Read in files from list in other file dynamically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816755#M322410</link>
      <description>&lt;P&gt;I am reading in the following dataset:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  data list;
      set project.daily_list;
    run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This gives:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5Nf0N.png" style="width: 576px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72030i5F3C46CC6DDA5129/image-size/large?v=v2&amp;amp;px=999" role="button" title="5Nf0N.png" alt="5Nf0N.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I want to read in, for each Date, a file in the NBBO column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, for 20140102:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data X;

set nbbo.NBBOM_20140102;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With X, I will do some operations. Then I want to save X (see below).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I want to do this for each nbbo file. In Rstudio I'd just use a for loop. But I am stuck on how to proceed in SAS. Please help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data project.final_nbbo_20140102;set X;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Jun 2022 20:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816755#M322410</guid>
      <dc:creator>amar961</dc:creator>
      <dc:date>2022-06-06T20:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Read in files from list in other file dynamically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816756#M322411</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Same &lt;A href="https://stackoverflow.com/questions/72522500/load-datasets-from-strings-in-other-file-in-a-loop" target="_self"&gt;clarifications required as on SO&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Set them into one data set?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; Individual one each?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; I'm assuming you don't want them all called X? Show what the final code should look like please.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 20:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816756#M322411</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-06T20:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read in files from list in other file dynamically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816759#M322412</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The files are from an external server, from which I want to download the data. The list data contains the names of the specific files I would like to download.&lt;/P&gt;&lt;P&gt;Since I can't alter the data on the external server, I can't set them into one data set. Furthermore, the files are 2gb each. Hence, I want to read them one-by-one (I don't know how), do some operations to get what I need (don't need help with that), and how to save them by giving them dynamic names (I don't know).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 20:43:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816759#M322412</guid>
      <dc:creator>amar961</dc:creator>
      <dc:date>2022-06-06T20:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read in files from list in other file dynamically</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816761#M322413</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427004"&gt;@amar961&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I can't alter the data on the external server, I can't set them into one data set.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure what makes you think that, but yes you can.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427004"&gt;@amar961&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hence, I want to read them one-by-one (I don't know how), do some operations to get what I need (don't need help with that), and how to save them by giving them dynamic names (I don't know).&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then you use the approach I outlined in my second link. You first create a working program. Then you convert it to a macro - think R function/package. Then call the macro/package for each data set listed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data set loops itself automatically so as you run through the data set, it'll call the function once for each data set using CALL EXECUTE.&lt;/P&gt;
&lt;P&gt;It starts with working code first for the process then determine how to generalize it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank" rel="noopener"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 21:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-in-files-from-list-in-other-file-dynamically/m-p/816761#M322413</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-06-06T21:00:04Z</dc:date>
    </item>
  </channel>
</rss>

