<?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: Using the input from a prompt to define a file path using a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521987#M141664</link>
    <description>&lt;P&gt;Thanks guys that's worked A&lt;/P&gt;</description>
    <pubDate>Mon, 17 Dec 2018 17:57:10 GMT</pubDate>
    <dc:creator>AJChamberlain</dc:creator>
    <dc:date>2018-12-17T17:57:10Z</dc:date>
    <item>
      <title>Using the input from a prompt to define a file path using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521946#M141656</link>
      <description>&lt;P&gt;Greetings SAS persons,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a prompt I am using in Enterprise Guide which requires the user to add a month in the input field in YYYYMM format, so for example '201811' for November 2018.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code&amp;nbsp;is creating a file which is exported as an excel file and I want to put into a folder, depending on the YYYYMM that is filled in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for example if the user puts 201811 in the prompt then the file&amp;nbsp;needs to get written to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"C:\My Directory\201811\MyExcelFiles_201811"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user puts in '201812' it will go into:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"C:\My Directory\201812\MyExcelFiles_201812"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and so on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I think I can define this with a macro in the code, but I am not sure how can anyone help please?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 15:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521946#M141656</guid>
      <dc:creator>AJChamberlain</dc:creator>
      <dc:date>2018-12-17T15:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using the input from a prompt to define a file path using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521948#M141657</link>
      <description>&lt;P&gt;Do you have working code that does not use macro language?&amp;nbsp; For example, if you knew that the user was going to enter 201812, do you have a program that would export the file to the proper folder?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 15:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521948#M141657</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-17T15:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using the input from a prompt to define a file path using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521954#M141658</link>
      <description>&lt;P&gt;Unfortunately not. I don't have to use a macro to solve this, if there's another way I'll take that!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 15:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521954#M141658</guid>
      <dc:creator>AJChamberlain</dc:creator>
      <dc:date>2018-12-17T15:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using the input from a prompt to define a file path using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521959#M141659</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some references that may help you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, just replace the value with the prompt with a &amp;amp; in front of it and period after. If you need to create a folder that doesn't already exist, you'll need to use DCREATE() to create the directory first with the file path and then use the path below to export it to.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"C:\My Directory\&amp;amp;Prompt_Value.\MyExcelFiles_&amp;amp;prompt_value..pdf"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&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/250288"&gt;@AJChamberlain&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Greetings SAS persons,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a prompt I am using in Enterprise Guide which requires the user to add a month in the input field in YYYYMM format, so for example '201811' for November 2018.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code&amp;nbsp;is creating a file which is exported as an excel file and I want to put into a folder, depending on the YYYYMM that is filled in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So for example if the user puts 201811 in the prompt then the file&amp;nbsp;needs to get written to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"C:\My Directory\201811\MyExcelFiles_201811"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the user puts in '201812' it will go into:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"C:\My Directory\201812\MyExcelFiles_201812"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and so on.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I think I can define this with a macro in the code, but I am not sure how can anyone help please?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 15:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521959#M141659</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-17T15:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using the input from a prompt to define a file path using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521987#M141664</link>
      <description>&lt;P&gt;Thanks guys that's worked A&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2018 17:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-the-input-from-a-prompt-to-define-a-file-path-using-a/m-p/521987#M141664</guid>
      <dc:creator>AJChamberlain</dc:creator>
      <dc:date>2018-12-17T17:57:10Z</dc:date>
    </item>
  </channel>
</rss>

