<?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: A macro to merge various xlsx files from the same subfolder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494205#M130201</link>
    <description>&lt;P&gt;Thank you soooo much. You brought tears to my eyes when the program ran flawless. I pray the 10x the rewards comes your way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;14 observations were read.....PERFECT! There were 14 xlsx files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, is how do I join (or merge) these 14 files vertically. Each files has a TP_ID as the unique identifier but also the ref_period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Sep 2018 17:10:58 GMT</pubDate>
    <dc:creator>dukem</dc:creator>
    <dc:date>2018-09-10T17:10:58Z</dc:date>
    <item>
      <title>A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494164#M130179</link>
      <description>&lt;P&gt;I'm trying to import several xlsx files from the same subfolder using macro. Then I would like to join them. I've read several previous posted and losing my mind. I'm new to using macro and want to challenge myself and to expand my SAS knowledge. The long version is as follows (then with proc sql to join the datasets).&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;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;replace&lt;/P&gt;&lt;P&gt;dbms=xlsx datafile='C:\Operations\CT\ Copy of ts_201706_final.xlsx"&lt;/P&gt;&lt;P&gt;out=Fer_fin__Jun17;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;replace&lt;/P&gt;&lt;P&gt;dbms=xlsx datafile='C:\Operations\CT\Copy of ts_201707_final.xlsx"&lt;/P&gt;&lt;P&gt;out=Fer_fin__Jul17;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;replace&lt;/P&gt;&lt;P&gt;dbms=xlsx datafile='C:\Operations\CT\ Copy of ts_201708_final.xlsx"&lt;/P&gt;&lt;P&gt;out=Fer_fin__Aug17;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;replace&lt;/P&gt;&lt;P&gt;dbms=xlsx datafile="C:\Operations\CT\ Copy of ts_201709_final.xlsx"&lt;/P&gt;&lt;P&gt;out=Fer_fin__Sep17;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt; &lt;STRONG&gt;import&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;replace&lt;/P&gt;&lt;P&gt;dbms=xlsx datafile='C:\Operations\CT\ Copy of ts_201710_final.xlsx"&lt;/P&gt;&lt;P&gt;out=Fer_fin_Oct17;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&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;I'm trying to follow the steps posted by previous members&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/How-to-import-multiple-Excel-file-to-SAS/td-p/151469/page/2" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/How-to-import-multiple-Excel-file-to-SAS/td-p/151469/page/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token comment"&gt;/* 1. Get file lists in the directory*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; dirlist pipe &lt;SPAN class="token string"&gt;'dir "D:\..." /b'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="token comment"&gt;/* 2. Resolve file names to SAS dataset "files" */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; files&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token function"&gt;length&lt;/SPAN&gt; fname &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;20&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; dirlist truncover &lt;SPAN class="token function"&gt;length&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; reclen&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; fname &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;varying20&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt; reclen&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="token comment"&gt;/* 3. Store the number of files we want to import into macro variable "nfile" */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _null_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; files nobs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; nobs&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;call &lt;SPAN class="token function"&gt;symput&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'nfile'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; nobs&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;stop&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="token comment"&gt;/* 4. Import all the files we want into SAS dataset*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token macrobound"&gt;%macro&lt;/SPAN&gt; fileinput&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token macroname"&gt;%local&lt;/SPAN&gt; i&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token macrostatement"&gt;%do&lt;/SPAN&gt; i&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; &lt;SPAN class="token macrostatement"&gt;%to&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;nfile&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token comment"&gt;/* Store import path and output filename into macro variables*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; _null_&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; files&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;firstobs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;i obs&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token comment"&gt;/* The length of fpath can't be over 201 since windows limitation */&lt;/SPAN&gt;&lt;BR /&gt;call &lt;SPAN class="token function"&gt;symput&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'fpath'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"D:\..."&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt; fname&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;call &lt;SPAN class="token function"&gt;symput&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'foutname'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;scan&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;fname&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'.'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token comment"&gt;/* Excel file import*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;import&lt;/SPAN&gt; out&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; work&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;foutname&lt;BR /&gt;datafile&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"&amp;amp;fpath"&lt;/SPAN&gt;&lt;BR /&gt;dbms&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;excel&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;replace&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"sheet1$"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;getnames&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;yes&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;mixed&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;no&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;scantext&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;yes&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;usedate&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;yes&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;scantime&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;yes&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token macrostatement"&gt;%end&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token macrobound"&gt;%mend&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token macroname"&gt;%fileinput&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 15:26:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494164#M130179</guid>
      <dc:creator>dukem</dc:creator>
      <dc:date>2018-09-10T15:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494166#M130181</link>
      <description>So what is the question you need help with? Something here not working as expected?&lt;BR /&gt;&lt;BR /&gt;Here's my version of that process, pretty similar though but it's tested. And do you mean merge (add columns) or append (add rows). &lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'm sure you've seen in previous threads mentioned this is unlikely to work because Excel guesses at types so it's like to read one file with a variable X as character and variable X as numeric in a different one causing issues when you try and append them.</description>
      <pubDate>Mon, 10 Sep 2018 15:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494166#M130181</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-10T15:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494173#M130183</link>
      <description>&lt;P&gt;Thank you Reeza.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is I'm looking for program that allows me to import 12 xlsx files from the same subfolder and joins (or merge)&amp;nbsp;them together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw your program and it's above my level of SAS understanding. Could highlight areas that require inputs from me* Where I should replace your program with specific&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My level of SAS is beginner to intermediate and have very little knowledge of macros.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 15:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494173#M130183</guid>
      <dc:creator>dukem</dc:creator>
      <dc:date>2018-09-10T15:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494174#M130184</link>
      <description>&lt;P&gt;They run in the order shown and the only line you should change is this portion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%list_files(c:\_localData\temp, xlsx);&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Add your path into that macro call and the extension type you're looking to import. This will not join the files, you haven't clarified how that should happen, see my original response. I would recommend importing all and then figuring that out. Once you have it figured out you can likely go back and modify the code to include it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The only parts of that code that are complex is the first macro that lists the files. It's not the most efficient design but should work on any OS.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 15:50:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494174#M130184</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-10T15:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494191#M130195</link>
      <description>&lt;P&gt;Thank you for detail explanation.&lt;/P&gt;&lt;P&gt;Yes, I plan on importing the files first then joining them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Question: What do you mean by "extension type" you're looking to import? I have the path&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro list_files(&lt;FONT color="#ff0000"&gt;C:\Users\savanahb\Downloads&lt;/FONT&gt;,&lt;FONT color="#ff6600"&gt; Copy of ts_2017&amp;amp;i_final.xlsx&lt;/FONT&gt;);&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 16:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494191#M130195</guid>
      <dc:creator>dukem</dc:creator>
      <dc:date>2018-09-10T16:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494197#M130200</link>
      <description>&lt;P&gt;When you list the files you need to specify the type/extension of files to list because you can have multiple different file types in the same folder.&amp;nbsp;In this case, the file&amp;nbsp;extension is used. The macro creates a data set with the file names. If you've created a list of file names why would you expect to call it with each file name? That's part of the process....the file names really don't matter, just the extension/type.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not sure what a file extension is:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://techterms.com/definition/fileextension" target="_blank"&gt;https://techterms.com/definition/fileextension&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You only need to change the single line I indicated, which is not what you've posted below. That's part of the macro declaration that &lt;STRONG&gt;SHOULD NOT&lt;/STRONG&gt; be changed.&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/232207"&gt;@dukem&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for detail explanation.&lt;/P&gt;
&lt;P&gt;Yes, I plan on importing the files first then joining them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question: What do you mean by "extension type" you're looking to import? I have the path&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro list_files(&lt;FONT color="#ff0000"&gt;C:\Users\savanahb\Downloads&lt;/FONT&gt;,&lt;FONT color="#ff6600"&gt; Copy of ts_2017&amp;amp;i_final.xlsx&lt;/FONT&gt;);&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 16:44:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494197#M130200</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-10T16:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494205#M130201</link>
      <description>&lt;P&gt;Thank you soooo much. You brought tears to my eyes when the program ran flawless. I pray the 10x the rewards comes your way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;14 observations were read.....PERFECT! There were 14 xlsx files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, is how do I join (or merge) these 14 files vertically. Each files has a TP_ID as the unique identifier but also the ref_period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 17:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494205#M130201</guid>
      <dc:creator>dukem</dc:creator>
      <dc:date>2018-09-10T17:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494210#M130203</link>
      <description>&lt;P&gt;I think you want to append them but I'm not sure. Like I mentioned before, are you adding columns or rows. Given your naming structure I suspect Append.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a quick way to append all files if they have a naming sequence, which yours did:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set data201801-data201812;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Sep 2018 17:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494210#M130203</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-10T17:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494216#M130205</link>
      <description>&lt;P&gt;I believe I'm adding rows. The columns are the same between all the files.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 17:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494216#M130205</guid>
      <dc:creator>dukem</dc:creator>
      <dc:date>2018-09-10T17:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494226#M130209</link>
      <description>&lt;P&gt;Then something like above data step will work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These are some of the ways you can shortcut list data sets and variables.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&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/232207"&gt;@dukem&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I believe I'm adding rows. The columns are the same between all the files.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Sep 2018 17:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494226#M130209</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-10T17:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to merge various xlsx files from the same subfolder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494879#M130500</link>
      <description>&lt;P&gt;Thank you kindly!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 14:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-merge-various-xlsx-files-from-the-same-subfolder/m-p/494879#M130500</guid>
      <dc:creator>dukem</dc:creator>
      <dc:date>2018-09-12T14:34:54Z</dc:date>
    </item>
  </channel>
</rss>

