<?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: Import Data Parameterize in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883549#M43264</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Supposing that the structure of the files being imported remains constant throughout the months and years, one way to do that is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, make sure that you selected the last option in the fourth step of the import object (you can "Modify task", select the option, and run to get the code):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_0-1688558875027.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85563i86C7199CD35F0550/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_0-1688558875027.png" alt="Jos_Costa_biw_0-1688558875027.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That code will make reference to the file you're importing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_1-1688559026252.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85564i50EB05E440D5A264/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_1-1688559026252.png" alt="Jos_Costa_biw_1-1688559026252.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, copy all the code of the import to a new program, add a %LET statement at the top to create the macro variable that will establish the yearmonth to run (i called it YEARMONTH, name it as you like):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_2-1688559230724.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85565iE1EF24DAC19146E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_2-1688559230724.png" alt="Jos_Costa_biw_2-1688559230724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and now you can replace with the new macro variable reference where needed (i don't know if the SAS table you're creating also contains the yearmonth, if it does, don't forget to replace there too), and run the program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_3-1688559297836.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85566iB055C4637EEDD8A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_3-1688559297836.png" alt="Jos_Costa_biw_3-1688559297836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two very important things here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When you reference a macro variable inside a string, the string must be delimited by double quotes ("), not single quotes ('). Double quotes will allow for macro variable resolve inside them, single macro quotes won't.&lt;/LI&gt;&lt;LI&gt;If you need to reference a macro variable inside a string and right before a period (.), as in this example, follow the macro variable reference with an additional period.&lt;BR /&gt;Notice that, in the last image, i have "TABLE&amp;amp;YEARMONTH&lt;STRONG&gt;..&lt;/STRONG&gt;csv".&lt;BR /&gt;The first period will be interpreted as a delimiter for the macro variable name and be "consumed", while the second period will be interpreted literally as a period.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;José Costa&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2023 12:24:45 GMT</pubDate>
    <dc:creator>José_Costa_biw</dc:creator>
    <dc:date>2023-07-05T12:24:45Z</dc:date>
    <item>
      <title>Import Data Parameterize</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883382#M43258</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS EG 8.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use File --&amp;gt; Import Data to import a few files to the SAS server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every new month, I have to Right Click the file and update the File Location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to parameterize the file location, so that all I just need to update from yymm=202304 to yymm = 202305 in a macro variable and the Import Data Wizard will pick up the new files?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IMPORTDATAFILELOCATION.PNG" style="width: 343px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85540iDE3BA27D77359D91/image-size/large?v=v2&amp;amp;px=999" role="button" title="IMPORTDATAFILELOCATION.PNG" alt="IMPORTDATAFILELOCATION.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 04:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883382#M43258</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2023-07-04T04:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Import Data Parameterize</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883400#M43261</link>
      <description>&lt;P&gt;Instead of the Import Wizard, use the &lt;A href="https://documentation.sas.com/doc/en/egdoccdc/8.2/egamotasks/p1asqbfxs0zrftn1qcl9ndmyfyxp.htm" target="_blank" rel="noopener"&gt;Copy Files&lt;/A&gt; task (where you can use macro variables), and a subsequent code node to read the file after it has been copied to the SAS server.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 09:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883400#M43261</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-04T09:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Import Data Parameterize</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883549#M43264</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Supposing that the structure of the files being imported remains constant throughout the months and years, one way to do that is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, make sure that you selected the last option in the fourth step of the import object (you can "Modify task", select the option, and run to get the code):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_0-1688558875027.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85563i86C7199CD35F0550/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_0-1688558875027.png" alt="Jos_Costa_biw_0-1688558875027.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That code will make reference to the file you're importing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_1-1688559026252.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85564i50EB05E440D5A264/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_1-1688559026252.png" alt="Jos_Costa_biw_1-1688559026252.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, copy all the code of the import to a new program, add a %LET statement at the top to create the macro variable that will establish the yearmonth to run (i called it YEARMONTH, name it as you like):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_2-1688559230724.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85565iE1EF24DAC19146E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_2-1688559230724.png" alt="Jos_Costa_biw_2-1688559230724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;... and now you can replace with the new macro variable reference where needed (i don't know if the SAS table you're creating also contains the yearmonth, if it does, don't forget to replace there too), and run the program:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jos_Costa_biw_3-1688559297836.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85566iB055C4637EEDD8A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jos_Costa_biw_3-1688559297836.png" alt="Jos_Costa_biw_3-1688559297836.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two very important things here:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When you reference a macro variable inside a string, the string must be delimited by double quotes ("), not single quotes ('). Double quotes will allow for macro variable resolve inside them, single macro quotes won't.&lt;/LI&gt;&lt;LI&gt;If you need to reference a macro variable inside a string and right before a period (.), as in this example, follow the macro variable reference with an additional period.&lt;BR /&gt;Notice that, in the last image, i have "TABLE&amp;amp;YEARMONTH&lt;STRONG&gt;..&lt;/STRONG&gt;csv".&lt;BR /&gt;The first period will be interpreted as a delimiter for the macro variable name and be "consumed", while the second period will be interpreted literally as a period.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;José Costa&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 12:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-Data-Parameterize/m-p/883549#M43264</guid>
      <dc:creator>José_Costa_biw</dc:creator>
      <dc:date>2023-07-05T12:24:45Z</dc:date>
    </item>
  </channel>
</rss>

