<?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 How to import multiple excel files using Macros's language in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372971#M89202</link>
    <description>&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;Hello, i decided to ask for help after multiple trials ...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;every month i have to import 3 excel files of the last 3 months&amp;nbsp; (for example: for april may and june: fichier_04_2017, fichier_05_2017, fichier_ 06_2017) with the intention of doing a comparison:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;How could i automate the macros variable in order to import files without having to change the month or the name &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;i calculated months and years like mentionned below &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; annee_mois;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Attrib&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; maintenant a b c &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;maintenant = today();&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a = (intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,maintenant,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;b = (intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,maintenant,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;c = (intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,maintenant,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a1 = put(year(a),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a2 = put(year(b),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a3 = put(year(c),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;M1 = put(month(a),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;M2 = put(month(b),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;M3 = put(month(c),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'a1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,a1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'M1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,M1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'a2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,a2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'M2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,M2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'a3'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,a3);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'M3'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,M3);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Run&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;And then i created my macro :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; importer (infile,outfile);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Proc import Out = &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;swork.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;infile (where =( Origine_score in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Client scoré'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) and type_personne in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Client'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) ) ) &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Datafile = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"adress\&amp;amp;outfile..xlsx"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Dbms = xlsx replace;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; importer;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;%&lt;STRONG&gt;&lt;I&gt;importer&lt;/I&gt;&lt;/STRONG&gt;(fichier_&amp;amp;m1._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;a1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,outils_rouges_&amp;amp;m1._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;a1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;i got this error message:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE 138-205: Line generated by the macro variable "INFILE".&lt;/P&gt;&lt;P&gt;1 swork.outils_rouges_&amp;amp;m1._&amp;amp;a1.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATAFILE, DATATABLE, DBMS,&lt;/P&gt;&lt;P&gt;DEBUG, FILE, OUT, REPLACE, TABLE, _DEBUG_.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "INFILE".&lt;/P&gt;&lt;P&gt;1 swork.outils_rouges_&amp;amp;m1._&amp;amp;a1.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;76&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference M1 not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference A1 not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference M1 not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference A1 not resolved.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 secondes&lt;/P&gt;&lt;P&gt;cpu time 0.00 secondes&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;Could someone help me to find out this problem, i think it didnt recognized the macro variable (m1, a1) which were declared at the beginning,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;Thank you a lot for your help,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="comic sans ms,sans-serif" size="2"&gt;&lt;FONT color="#333399"&gt;Marwa &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2017 12:49:05 GMT</pubDate>
    <dc:creator>Marwa_Se</dc:creator>
    <dc:date>2017-07-04T12:49:05Z</dc:date>
    <item>
      <title>How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372971#M89202</link>
      <description>&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;Hello, i decided to ask for help after multiple trials ...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;every month i have to import 3 excel files of the last 3 months&amp;nbsp; (for example: for april may and june: fichier_04_2017, fichier_05_2017, fichier_ 06_2017) with the intention of doing a comparison:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;How could i automate the macros variable in order to import files without having to change the month or the name &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif"&gt;i calculated months and years like mentionned below &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; annee_mois;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Attrib&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; maintenant a b c &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; = &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;maintenant = today();&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a = (intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,maintenant,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;b = (intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,maintenant,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;c = (intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,maintenant,-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a1 = put(year(a),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a2 = put(year(b),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a3 = put(year(c),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$4.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;M1 = put(month(a),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;M2 = put(month(b),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;M3 = put(month(c),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$2.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'a1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,a1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'M1'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,M1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'a2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,a2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'M2'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,M2);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'a3'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,a3);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symput(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'M3'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,M3);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Run&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;And then i created my macro :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; importer (infile,outfile);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Proc import Out = &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;swork.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;amp;infile (where =( Origine_score in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Client scoré'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) and type_personne in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Client'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) ) ) &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Datafile = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"adress\&amp;amp;outfile..xlsx"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Dbms = xlsx replace;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; importer;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;%&lt;STRONG&gt;&lt;I&gt;importer&lt;/I&gt;&lt;/STRONG&gt;(fichier_&amp;amp;m1._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;a1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,outils_rouges_&amp;amp;m1._&amp;amp;&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;a1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;i got this error message:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE 138-205: Line generated by the macro variable "INFILE".&lt;/P&gt;&lt;P&gt;1 swork.outils_rouges_&amp;amp;m1._&amp;amp;a1.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATAFILE, DATATABLE, DBMS,&lt;/P&gt;&lt;P&gt;DEBUG, FILE, OUT, REPLACE, TABLE, _DEBUG_.&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the macro variable "INFILE".&lt;/P&gt;&lt;P&gt;1 swork.outils_rouges_&amp;amp;m1._&amp;amp;a1.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;76&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference M1 not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference A1 not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference M1 not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference A1 not resolved.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 secondes&lt;/P&gt;&lt;P&gt;cpu time 0.00 secondes&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;Could someone help me to find out this problem, i think it didnt recognized the macro variable (m1, a1) which were declared at the beginning,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399" face="comic sans ms,sans-serif" size="2"&gt;Thank you a lot for your help,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="comic sans ms,sans-serif" size="2"&gt;&lt;FONT color="#333399"&gt;Marwa &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 12:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372971#M89202</guid>
      <dc:creator>Marwa_Se</dc:creator>
      <dc:date>2017-07-04T12:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372982#M89205</link>
      <description>&lt;P&gt;The reason is those macro variables are not Global but local outside the macro - you can check the documentation on variable scope.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would do:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  do i=0 to 2;
    import_date=put(intnx("month",today()-2,i),yymm7.);
    call execute(cats('proc import datafile="fichier_',import_date,'.xlsx out=import',put(i,1.),' replace; run;'));
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;This does the 3 months of -3 to today() and creates the proc import step for each one.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 13:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372982#M89205</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-04T13:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372984#M89207</link>
      <description>&lt;P&gt;First of all, take a look at your log and get rid of the WARNING messages caused by using a character format on a numeric variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data annee_mois;
attrib maintenant a b c format = date9.;
maintenant = today();
a = (intnx('month',maintenant,-1));
b = (intnx('month',maintenant,-2));
c = (intnx('month',maintenant,-3));
a1 = put(year(a),z4.);
a2 = put(year(b),z4.);
a3 = put(year(c),z4.);
m1 = put(month(a),z2.);
m2 = put(month(b),z2.);
m3 = put(month(c),z2.);
call symput('a1',a1);
call symput('m1',m1);
call symput('a2',a2);
call symput('m2',m2);
call symput('a3',a3);
call symput('m3',m3);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note the use of the Zw. format to preserve leading zeroes and prevent blanks.&lt;/P&gt;
&lt;P&gt;Now, if you run this immediately afterwards:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro importer (infile,outfile);
/*
Proc import Out = swork.&amp;amp;infile (where =( Origine_score in ('Client scoré') and type_personne in ('Client') ) )
Datafile = "adress\&amp;amp;outfile..xlsx"
Dbms = xlsx replace;
Run;
*/
%put &amp;amp;infile &amp;amp;outfile;
%mend importer;

%importer(fichier_&amp;amp;m1._&amp;amp;a1.,outils_rouges_&amp;amp;m1._&amp;amp;a1.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you will find two valid dataset/file names in the log, so the import step should work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 13:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/372984#M89207</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-04T13:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373001#M89215</link>
      <description>&lt;P&gt;Thank you for your quickly answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; i'm not familiar with the macro language that's why i can't differentiate between local and global variables,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried your code, it seems answering my question but i got an error message again &lt;img id="smileyembarrassed" class="emoticon emoticon-smileyembarrassed" src="https://communities.sas.com/i/smilies/16x16_smiley-embarrassed.png" alt="Smiley Embarassed" title="Smiley Embarassed" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i think there is something wrong&amp;nbsp;with the call&amp;nbsp;execute. In fact, &amp;nbsp;should i mention&amp;nbsp;quotation marks between the whole path&amp;nbsp;after &amp;nbsp;the datafile ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_null_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;import_date=put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"month"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,today()-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,i),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymm7.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; execute(cats(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'proc import datafile="C:\Users\VFMarwa\Desktop\Perso\Marwa Perso\Marwa\outils_rouges_'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;import_date,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'.xlsx out=import'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,put(i,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;),&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;' replace; run;'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway i got this error message&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: Line generated by the CALL EXECUTE routine.&lt;/P&gt;&lt;P&gt;3 + proc import&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;202&lt;/P&gt;&lt;P&gt;3 !+datafile="\\VFAPP007\appli\ADMBANQ\ADM_INFORMATIONNEL\Conformité\LAB_vigilance\outils_roug&lt;/P&gt;&lt;P&gt;3 !+es_2017M09.xlsx out=import2replace; run;"&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, DATAFILE, DATATABLE, DBMS,&lt;/P&gt;&lt;P&gt;DEBUG, FILE, OUT, REPLACE, TABLE, _DEBUG_.&lt;/P&gt;&lt;P&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm really a beginner with macro my question may seems evident for you ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 13:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373001#M89215</guid>
      <dc:creator>Marwa_Se</dc:creator>
      <dc:date>2017-07-04T13:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373005#M89218</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;thank you for your answer, but i think that my problem is related to global and local variables ...&lt;/P&gt;&lt;P&gt;i will try to work with the call excute ...&lt;/P&gt;&lt;P&gt;i still have errors with the code above &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 13:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373005#M89218</guid>
      <dc:creator>Marwa_Se</dc:creator>
      <dc:date>2017-07-04T13:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373007#M89220</link>
      <description>&lt;P&gt;Yes, just missing a double quote to end filename (after .xlsx):&lt;/P&gt;
&lt;PRE&gt;data _null_;
  do i=0 to 2;
    import_date=put(intnx("month",today()-2,i),yymm7.);
    call execute(cats('proc import datafile="C:\Users\VFMarwa\Desktop\Perso\MarwaPerso\Marwa\outils_rouges_',import_date,'.xlsx" out=import',put(i,1.),' replace; run;'));
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Note I use the code window to post code - keeps formatting and makes it easier to read - its the {i} above post area.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373007#M89220</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-04T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373008#M89221</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;i corrected the path, i added a quotation mark after the (.xlsx') it worked, but i obtained another error message:&lt;/P&gt;&lt;P&gt;the file format it's not correct,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried to excute only this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; date;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;import_date=put(intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"month"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,today()-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,i),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymm7.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;run&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;the date format wasn't correct ( for i=3 import_date=2017M09 ) yet i need to keep the format below(Fichier_Month_Year.xlsx)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do u have any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again ..&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:14:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373008#M89221</guid>
      <dc:creator>Marwa_Se</dc:creator>
      <dc:date>2017-07-04T14:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373016#M89225</link>
      <description>&lt;P&gt;Yes, you need to change the line:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;import_date=put(intnx(&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#800080"&gt;"month"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,today()-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,i),&lt;/FONT&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;yymm7.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;To match what your filename is, so maybe:&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;import_date=catx("_",put(month(intnx("month",today()-2,i)),z2.),put(year(intnx("month",today()-2,i)),z4.));
&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;This should create immport_date variable as MM_YYYY to be concatenated in the call execute.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373016#M89225</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-04T14:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to import multiple excel files using Macros's language</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373024#M89227</link>
      <description>&lt;P&gt;It works good!! you're really a genius &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &amp;nbsp;Only one thing "i" must starts from -3 to -1 in order to obtain &amp;nbsp;the last 3 months&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so (do i= -3 to -1;) instead of (do i=0 to 2;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help you saved my life &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-import-multiple-excel-files-using-Macros-s-language/m-p/373024#M89227</guid>
      <dc:creator>Marwa_Se</dc:creator>
      <dc:date>2017-07-04T14:45:34Z</dc:date>
    </item>
  </channel>
</rss>

