<?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: Load Current SAS Program Name to macro variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490375#M128285</link>
    <description>I have program name ABC. I want to create a macro variable name PGM and it should have a value ABC. Do we have any system option or automatic macro variable for that?</description>
    <pubDate>Tue, 28 Aug 2018 08:24:18 GMT</pubDate>
    <dc:creator>vandhan</dc:creator>
    <dc:date>2018-08-28T08:24:18Z</dc:date>
    <item>
      <title>Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490349#M128272</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on some comparing datasets and wanted to make sure compare program using the correct datasets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EX: my program name is A. I want to compare A dataset with AA. But issue arised here is programmer compared B with BB and compare report showing all matched in program A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to make sure in A program they compared only A dataset with AA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I wanted mitigation plan here and load program (A) name into pgm macro variable in A program. and call pgm macro variable as input dataset in compare setp.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 07:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490349#M128272</guid>
      <dc:creator>vandhan</dc:creator>
      <dc:date>2018-08-28T07:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490368#M128279</link>
      <description>&lt;P&gt;It depends on the way you run your program.&lt;/P&gt;
&lt;P&gt;In batch mode, there is a macro variable SYSPROCESSNAME that you can use.&lt;/P&gt;
&lt;P&gt;From EG, you can see the current node name from within the project tree as _CLIENTTASKLABEL.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490368#M128279</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-28T08:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490370#M128281</link>
      <description>&lt;P&gt;What software are you using, e.g. Base, Enterprise Guide etc.&amp;nbsp; How do you call the proc compare?&amp;nbsp; Surely you would have a paramter from that you can use?&lt;/P&gt;
&lt;PRE&gt;%comp (inds=abc,compds=abcd);
  title "Dataset=&amp;amp;inds.  Comp=&amp;amp;Comp.";
...
&lt;/PRE&gt;
&lt;P&gt;Need some information to proceed.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:17:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490370#M128281</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-28T08:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490373#M128283</link>
      <description>I am using EG only. i wanted to load A value to inds macro variable in this case.</description>
      <pubDate>Tue, 28 Aug 2018 08:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490373#M128283</guid>
      <dc:creator>vandhan</dc:creator>
      <dc:date>2018-08-28T08:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490374#M128284</link>
      <description>&lt;P&gt;Please present an example of what you mean, show some code, show what you want to see.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490374#M128284</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-28T08:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490375#M128285</link>
      <description>I have program name ABC. I want to create a macro variable name PGM and it should have a value ABC. Do we have any system option or automatic macro variable for that?</description>
      <pubDate>Tue, 28 Aug 2018 08:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490375#M128285</guid>
      <dc:creator>vandhan</dc:creator>
      <dc:date>2018-08-28T08:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490379#M128286</link>
      <description>&lt;P&gt;Well in Base there is:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/301.html" target="_blank"&gt;http://support.sas.com/kb/24/301.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't know if that works in EG.&amp;nbsp; Why should the filename drive parameter though?&amp;nbsp; Would it not be better to generalise the compare and use paramters.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490379#M128286</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-28T08:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Load Current SAS Program Name to macro variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490380#M128287</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12567"&gt;@vandhan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I have program name ABC. I want to create a macro variable name PGM and it should have a value ABC. Do we have any system option or automatic macro variable for that?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Look at the log as returned to EG. You'll find the variables created by EG right at the top:&lt;/P&gt;
&lt;PRE&gt;1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='mytest';
4          %LET _CLIENTPROJECTPATH='';
5          %LET _CLIENTPROJECTNAME='';
6          %LET _SASPROGRAMFILE=;
&lt;/PRE&gt;
&lt;P&gt;With EG after 7.13 (or 7.13 with a hotfix applied), _SASPROGRAMFILE will also be populated.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Load-Current-SAS-Program-Name-to-macro-variable/m-p/490380#M128287</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-28T08:43:21Z</dc:date>
    </item>
  </channel>
</rss>

