<?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 a CSV file from a URL with varying date value in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468548#M30392</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214321"&gt;@968107&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;A Prompt allows you to take user input during runtime of a program.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the SAS code the prompt name is a SAS Macro variable with the value the user entered/selected.&lt;/P&gt;
&lt;P&gt;You can use this SAS Macro variable in your code and it will resolve to the value before the SAS code executes (macro "pre-processing").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't want to define this in a single EG project as then you'd have to distribute copies of this project to your users which makes this unmanageable. For this reason you should implement such a process with a prompt as a Stored Process (centrally saved on the SAS server side) which then can be called out of EG (or other clients).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For above to work you'll have to verify that your site got the license for Stored Processes. If yes then below link should give you a starting point.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=stpug&amp;amp;docsetTarget=stpugwhatsnew94.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&amp;nbsp;" target="_blank"&gt;http://documentation.sas.com/?docsetId=stpug&amp;amp;docsetTarget=stpugwhatsnew94.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jun 2018 22:27:48 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-06-07T22:27:48Z</dc:date>
    <item>
      <title>Import a CSV file from a URL with varying date value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468544#M30391</link>
      <description>&lt;P&gt;I'm trying to compile unique csv files that are generated daily, and attempting to automate that within EG. The url&amp;nbsp;file path will end in the date with a&amp;nbsp; format of "7-Jun-2018".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a thought of possibly prompting the user to select the date they would like to use, and have EG pull that specific day's files. I don't know how to take that user input and translate that to a URL path to grab the files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to use a variable piece of data, like the desired date, and insert that into part of the URL file path to get the desired daily file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm relatively new to EG, so I know this is a broad question. I'm hoping to get a general direction I should start heading.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 21:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468544#M30391</guid>
      <dc:creator>968107</dc:creator>
      <dc:date>2018-06-07T21:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file from a URL with varying date value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468548#M30392</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/214321"&gt;@968107&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;A Prompt allows you to take user input during runtime of a program.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the SAS code the prompt name is a SAS Macro variable with the value the user entered/selected.&lt;/P&gt;
&lt;P&gt;You can use this SAS Macro variable in your code and it will resolve to the value before the SAS code executes (macro "pre-processing").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't want to define this in a single EG project as then you'd have to distribute copies of this project to your users which makes this unmanageable. For this reason you should implement such a process with a prompt as a Stored Process (centrally saved on the SAS server side) which then can be called out of EG (or other clients).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For above to work you'll have to verify that your site got the license for Stored Processes. If yes then below link should give you a starting point.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=stpug&amp;amp;docsetTarget=stpugwhatsnew94.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&amp;nbsp;" target="_blank"&gt;http://documentation.sas.com/?docsetId=stpug&amp;amp;docsetTarget=stpugwhatsnew94.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 22:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468548#M30392</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-06-07T22:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file from a URL with varying date value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468557#M30393</link>
      <description>&lt;P&gt;Is definitely possible to generate part of code using a macro variable. That is what they were created to do.&lt;/P&gt;
&lt;P&gt;Just create the macro variable with the string of characters you need and replace the hardcoded value with the macro variable reference.&amp;nbsp;&amp;nbsp;Since a filename (or URL in this case) is normally entered as a string literal, make sure to use double quotes on the outside so that SAS will resolve the macro variable references on the inside.&lt;/P&gt;
&lt;P&gt;EG prompts will probably return the value in DATE9 format, but it looks like you need the value in DATE11 format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let prompt_value = 01JAN2018 ;
%let for_url = %sysfunc(putn("&amp;amp;prompt_value"d,date11));
.....
filename myurl url "http://....&amp;amp;for_url....." .... ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might need to add more code to remove leading zero if that is required. Or change the case of the month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more support with exactly how to code it you need show exactly what you need to create.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also when dealing with URLs that might already have &amp;amp; characters in it you might find it easier to generate the string using a data step. You can use CALL SYMPUTX() to convert the generated string into a macro variable if you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 00:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468557#M30393</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-06-08T00:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Import a CSV file from a URL with varying date value</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468571#M30395</link>
      <description>&lt;P&gt;In SAS EG open view&amp;gt;Prompt Manage, You can see at left side. Click add and name your prompt value and then click the next tab for prompt values. Select the following as mentioned in the screenshot. You can give min and max values if you wish.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21102iE0F48326C868C4B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Now right click the program you want the prompt and choose properties&amp;gt;Prompts (Added the created prompt here). Now you can see a small question mark for your program&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 38px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21103i088F9AA30F3117DC/image-dimensions/38x38?v=v2" width="38" height="38" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your program you can refresence the prompt as macro variable as follows&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date_value=%sysfunc(INPUTN(&amp;amp;date, date9.), date11.);
%PUT "https://communities.sas.com/&amp;amp;date_value";
&lt;/CODE&gt;&lt;/PRE&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>Fri, 08 Jun 2018 01:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Import-a-CSV-file-from-a-URL-with-varying-date-value/m-p/468571#M30395</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-06-08T01:56:15Z</dc:date>
    </item>
  </channel>
</rss>

