<?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 SAS Merge and Import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Merge-and-Import/m-p/445815#M283144</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS&amp;nbsp;Dataset (A) containing c. 50k unique keys that I would like to merge to&amp;nbsp;a specific Excel files (B) depending on month and year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Dataset (A) includes; unique 'key' (example format: A12345)&amp;nbsp; and 'date opened' (example format: 29/04/2015).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(B) is essentially a folder structure with several years and months with example as follows:&amp;nbsp;2015&amp;gt;April. Inside the April folder is an Excel called April 15 and includes 'score'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get SAS to locate the correct month from the folder structure (depending on date opened), import it and merge to it, so I end up with something like this where score&amp;nbsp;&lt;SPAN&gt;score is appended to Dataset A&lt;/SPAN&gt;&amp;nbsp;for each unique key:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Key (A1234) data opened (&lt;SPAN&gt;29/04/2015) score (10)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Key (B123) data opened (13/08/2017) score (6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pete&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Mar 2018 12:59:29 GMT</pubDate>
    <dc:creator>PetePatel</dc:creator>
    <dc:date>2018-03-15T12:59:29Z</dc:date>
    <item>
      <title>SAS Merge and Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Merge-and-Import/m-p/445815#M283144</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS&amp;nbsp;Dataset (A) containing c. 50k unique keys that I would like to merge to&amp;nbsp;a specific Excel files (B) depending on month and year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Dataset (A) includes; unique 'key' (example format: A12345)&amp;nbsp; and 'date opened' (example format: 29/04/2015).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(B) is essentially a folder structure with several years and months with example as follows:&amp;nbsp;2015&amp;gt;April. Inside the April folder is an Excel called April 15 and includes 'score'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get SAS to locate the correct month from the folder structure (depending on date opened), import it and merge to it, so I end up with something like this where score&amp;nbsp;&lt;SPAN&gt;score is appended to Dataset A&lt;/SPAN&gt;&amp;nbsp;for each unique key:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Key (A1234) data opened (&lt;SPAN&gt;29/04/2015) score (10)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Key (B123) data opened (13/08/2017) score (6)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pete&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 12:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Merge-and-Import/m-p/445815#M283144</guid>
      <dc:creator>PetePatel</dc:creator>
      <dc:date>2018-03-15T12:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Merge and Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Merge-and-Import/m-p/445833#M283145</link>
      <description>&lt;P&gt;Step 1: set up a directory and filename structure that makes sense, using ISO-formatted dates (YYYY-MM-DD). That makes the subsequent steps easier.&lt;/P&gt;
&lt;P&gt;Step 2: import all files from there into one contiguous SAS dataset; add the date from the name of the individual file as a variable to the dataset&lt;/P&gt;
&lt;P&gt;Step 3: join along keys and the newly created variable.&lt;/P&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:50:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Merge-and-Import/m-p/445833#M283145</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-15T13:50:23Z</dc:date>
    </item>
  </channel>
</rss>

