<?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: How to create a macro variable containing the name of the SAS file being run in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92464#M19495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It exists already:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put %sysget(SAS_EXECFILENAME);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/301.html" title="http://support.sas.com/kb/24/301.html"&gt;http://support.sas.com/kb/24/301.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2012 21:30:35 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2012-08-13T21:30:35Z</dc:date>
    <item>
      <title>How to create a macro variable containing the name of the SAS file being run</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92463#M19494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to write a macro that ends up creating a dataset and I want that dataset to be named whatever the name of the SAS code is that it is run on followed by _STATS.&amp;nbsp; Basically I am trying to find out if there is a way to create a macro variable that's value is the name of the program currently being run.&amp;nbsp; This will be part of an automated process so I need it to run without manual intervention.&amp;nbsp; I was hoping there was an automatic macro variable that had this information but it does not appear to be the case.&amp;nbsp; Is there a proc or something else that would allow the file name to be stored as a macro variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program name = Query123.sas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro variable to be created = Query123&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 20:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92463#M19494</guid>
      <dc:creator>lsirakos</dc:creator>
      <dc:date>2012-08-13T20:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable containing the name of the SAS file being run</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92464#M19495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It exists already:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put %sysget(SAS_EXECFILENAME);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/301.html" title="http://support.sas.com/kb/24/301.html"&gt;http://support.sas.com/kb/24/301.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 21:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92464#M19495</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-08-13T21:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a macro variable containing the name of the SAS file being run</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92465#M19496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 21:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-macro-variable-containing-the-name-of-the-SAS/m-p/92465#M19496</guid>
      <dc:creator>lsirakos</dc:creator>
      <dc:date>2012-08-13T21:32:40Z</dc:date>
    </item>
  </channel>
</rss>

