<?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 import multiple Excel files from a folder into SAS? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/447718#M112529</link>
    <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i trust you are well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the swift response to my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it would be befitting to share what i have learned such that other individuals new to SAS can benefit =).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have learned the following wrt macros:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a code generator which can be used to make repetitive coding more efficient.&lt;/P&gt;&lt;P&gt;Below are the steps i took to code a macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hard code the SAS program you are keen to make efficient with a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Ensure the code in step 1 runs correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Add a macro&lt;/P&gt;&lt;P&gt;%macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Name your macro&lt;/P&gt;&lt;P&gt;%macro MyFirstMacro;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;End the macro&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Place code from step 1 between %macro MyfirstMacro; and %mend;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;%macro MyFirstMacro;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;insert Code From Step 1 Here.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;%mend MyFirstMacro;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Run Step 6.&lt;/P&gt;&lt;P&gt;SAS will not output any result yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Call the assigned macro by it`s name.&lt;/P&gt;&lt;P&gt;%let&amp;nbsp;MyFirstMacro;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Add Variable (s).&lt;/P&gt;&lt;P&gt;%let&amp;nbsp;&lt;SPAN&gt;MyFirstMacro (variable 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let&amp;nbsp;MyFirstMacro (variable 2);&lt;/SPAN&gt;&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;Step 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add placeholder where the called macro will look in; to generate code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%macro MyFirstMacro&amp;nbsp; &amp;nbsp; &amp;nbsp; (general descriptor name given to describe variable 1 &amp;amp; variable 2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Add ampersand (&amp;amp;)&amp;nbsp;where applicable to the code in step 1 which have been inserted between %macro MyFirstMacro; AND %mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add a second full stop to end the macro. You can have to full stops next to each other like this ..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Macro looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro MyFirstMacro&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(month);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Title "Q2";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc import out =Months_Q2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Datafile= "\\string\&amp;amp;month..xls"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DBMS= Excel2010 replace;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sheet='Sheet1';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GETNAMES=YES;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MIXED=NO;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;%mend MyFirstMacro ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MyFirstMacro (Variable1);&lt;BR /&gt;%MyFirstMacro (Variable2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;New_2_this&lt;/SPAN&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 10:35:02 GMT</pubDate>
    <dc:creator>New_2_this</dc:creator>
    <dc:date>2018-03-22T10:35:02Z</dc:date>
    <item>
      <title>A macro to import multiple Excel files from a folder into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/446722#M112136</link>
      <description>&lt;P&gt;Hi SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please could someone assist me? I am new to SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Objective:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To import many excel files into sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Understanding:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. a macro can be used.&lt;/P&gt;&lt;P&gt;2. I am able to import a single excel file into sas.&lt;/P&gt;&lt;P&gt;3. I have not edited the code correctly due to lack of understanding&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Background:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Each excel file has a unique name.&lt;/P&gt;&lt;P&gt;All excel files are stored in a FOLDER_GENERIC_NAME&lt;/P&gt;&lt;P&gt;I want to import all excel files stored in FOLDER_GENERIC_NAME to sas&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;What I have done thus far:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Attempted to adapt the code found online to meet my objective.&lt;/P&gt;&lt;P&gt;Below is the code I attempted to customize to meet my objective.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*Scanning Excel Files*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data playpen_dirlisting;&lt;BR /&gt;drop rc did i;&lt;BR /&gt;rc=GENERIC_FOLDER_NAME("NAME_OF_FOLDER_WHERE_EXCEL_FILES_ARE_FOUND" , "\\ FILE_LOCATION");&lt;BR /&gt;did-DOPEN("&lt;SPAN&gt;NAME_OF_FOLDER_WHERE_EXCEL_FILES_ARE_FOUND&lt;/SPAN&gt;");&lt;BR /&gt;IF did &amp;gt; 0 then do;&lt;BR /&gt;do i=1 to DNUM(did);&lt;BR /&gt;name=DREAD(did,i)&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;rc=DCLOSE(did);&lt;BR /&gt;ENDl;&lt;BR /&gt;ELSE PUT 'Could not open dir';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*Creating Names for data sets when reading in many excel files*/&lt;BR /&gt;&lt;BR /&gt;libname mcrsheet "%sysfunc(trim(&amp;amp;&amp;amp;NAME_OF_EXCEL_FILE&amp;amp;c))";&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;create table outsheet&amp;amp;c as&lt;BR /&gt;select distinct memname&lt;BR /&gt;from playpen_dirlisting;&lt;BR /&gt;where libname="macrsheet" And nametype="DATA" And INDEX(memname,'$');&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data outsheet&amp;amp;c;&lt;BR /&gt;set outsheet&amp;amp;c (rename=(memname=sheet));&lt;BR /&gt;fileloc="&amp;amp;&amp;amp;NAME_OF_EXCEL_FILE&amp;amp;c";&lt;BR /&gt;name="&amp;amp;&amp;amp;EXCEL_FILE_NAME&amp;amp;c";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;libname mcrsheet clear;&lt;/P&gt;&lt;P&gt;/*Importing the actual excel files*/&lt;BR /&gt;&lt;BR /&gt;libname newdata "%sysfunc(trim(&amp;amp;&amp;amp;FILE_LOCATION&amp;amp;c))";&lt;/P&gt;&lt;P&gt;data work.&amp;amp;&amp;amp; dataset_name&amp;amp;c (drop=obs);&lt;BR /&gt;set newdata."%sysfunc(trim(&amp;amp;&amp;amp;sheet&amp;amp;c)) $" n;&lt;BR /&gt;obs=_n_;&lt;BR /&gt;if obs&amp;gt;0 then call symputx ("rep" , "yes");&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;libname newdata clear;&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;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 11:18:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/446722#M112136</guid>
      <dc:creator>New_2_this</dc:creator>
      <dc:date>2018-03-19T11:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to import multiple Excel files from a folder into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/446745#M112140</link>
      <description>&lt;P&gt;Here’s an example&lt;/P&gt;
&lt;P&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;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 12:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/446745#M112140</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-19T12:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: A macro to import multiple Excel files from a folder into SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/447718#M112529</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i trust you are well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the swift response to my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it would be befitting to share what i have learned such that other individuals new to SAS can benefit =).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have learned the following wrt macros:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a code generator which can be used to make repetitive coding more efficient.&lt;/P&gt;&lt;P&gt;Below are the steps i took to code a macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hard code the SAS program you are keen to make efficient with a macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Ensure the code in step 1 runs correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Add a macro&lt;/P&gt;&lt;P&gt;%macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Name your macro&lt;/P&gt;&lt;P&gt;%macro MyFirstMacro;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;End the macro&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 6&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Place code from step 1 between %macro MyfirstMacro; and %mend;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;%macro MyFirstMacro;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;insert Code From Step 1 Here.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;%mend MyFirstMacro;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 7&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Run Step 6.&lt;/P&gt;&lt;P&gt;SAS will not output any result yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Call the assigned macro by it`s name.&lt;/P&gt;&lt;P&gt;%let&amp;nbsp;MyFirstMacro;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Add Variable (s).&lt;/P&gt;&lt;P&gt;%let&amp;nbsp;&lt;SPAN&gt;MyFirstMacro (variable 1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let&amp;nbsp;MyFirstMacro (variable 2);&lt;/SPAN&gt;&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;Step 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add placeholder where the called macro will look in; to generate code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%macro MyFirstMacro&amp;nbsp; &amp;nbsp; &amp;nbsp; (general descriptor name given to describe variable 1 &amp;amp; variable 2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Add ampersand (&amp;amp;)&amp;nbsp;where applicable to the code in step 1 which have been inserted between %macro MyFirstMacro; AND %mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Add a second full stop to end the macro. You can have to full stops next to each other like this ..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Macro looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro MyFirstMacro&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(month);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Title "Q2";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;proc import out =Months_Q2&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Datafile= "\\string\&amp;amp;month..xls"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DBMS= Excel2010 replace;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sheet='Sheet1';&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GETNAMES=YES;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MIXED=NO;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; run;&lt;BR /&gt;%mend MyFirstMacro ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MyFirstMacro (Variable1);&lt;BR /&gt;%MyFirstMacro (Variable2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;New_2_this&lt;/SPAN&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 10:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-macro-to-import-multiple-Excel-files-from-a-folder-into-SAS/m-p/447718#M112529</guid>
      <dc:creator>New_2_this</dc:creator>
      <dc:date>2018-03-22T10:35:02Z</dc:date>
    </item>
  </channel>
</rss>

