From: Tom Abernathy on
Matt -
From my experimentation the environment variable SAS_EXECFILEPATH is
set by the Enhanced Editor when you save a file. So if you are not
using the enhanced editor or have not save the code yet then it will
have an empty value.
- Tom

On Nov 10, 4:55 pm, matt.pet...(a)THOMSONREUTERS.COM (Matthew Pettis)
wrote:
> Hi,
>
> I wrote a while back to get an answer to how to get the directory of the
> currently executing script, which was answered by Ron Fehd athttp://listserv.uga.edu/cgi-bin/wa?A2=ind0904D&L=sas-l&P=R21205&D=0&m...
> .  Now I have upgraded to SAS9.2, and this no longer works.  Does anybody
> have the same experience and/or know what is wrong?  The log is below.
>
> Thanks,
> Matt
>
> === SAS Log (Run in interactive mode) ===
>
> NOTE: Copyright (c) 2002-2008 by SAS Institute Inc., Cary, NC, USA.
> NOTE: SAS (r) Proprietary Software 9.2 (TS2M0)
> NOTE: This session is executing on the XP_PRO  platform.
>
> NOTE: SAS initialization used:
>       real time           12.12 seconds
>       cpu time            0.79 seconds
>
> 1    %let execpath=" ";
> 2    %macro setexecpath;
> 3       %let execpath=%sysfunc(GetOption(SYSIN));
> 4       %if %length(&execpath)=0
> 5          %then %let execpath=%sysget(SAS_EXECFILEPATH);
> 6    %mend setexecpath;
> 7
> 8    %setexecpath;
> 9    %put &execpath;
>
> 10
> 11   %put Submitted file path is %sysget(SAS_EXECFILEPATH).;
> Submitted file path is  .
> 12   %put Submitted file name is %sysget(SAS_EXECFILENAME).;
> Submitted file name is  .
>
> <snip>
>
> 17   %let FileSpec=%sysget(SAS_EXECFILEPATH);
> 18   %put FileSpec: &FileSpec.;
> FileSpec:

From: Matthew Pettis on
Problem is solved -- False Alarm. I was doing some testing in the enhanced
editor, and was executing this code from an unsaved 'Edit1' file. There was
no path because there was no file into which the code was saved.

Matt

On Tue, 10 Nov 2009 16:55:08 -0500, Matthew Pettis
<matt.pettis(a)THOMSONREUTERS.COM> wrote:

>Hi,
>
>I wrote a while back to get an answer to how to get the directory of the
>currently executing script, which was answered by Ron Fehd at
>http://listserv.uga.edu/cgi-bin/wa?A2=ind0904D&L=sas-
l&P=R21205&D=0&m=283518
>. Now I have upgraded to SAS9.2, and this no longer works. Does anybody
>have the same experience and/or know what is wrong? The log is below.
>
>Thanks,
>Matt
>
>
>
>=== SAS Log (Run in interactive mode) ===
>
>NOTE: Copyright (c) 2002-2008 by SAS Institute Inc., Cary, NC, USA.
>NOTE: SAS (r) Proprietary Software 9.2 (TS2M0)
>NOTE: This session is executing on the XP_PRO platform.
>
>
>
>NOTE: SAS initialization used:
> real time 12.12 seconds
> cpu time 0.79 seconds
>
>1 %let execpath=" ";
>2 %macro setexecpath;
>3 %let execpath=%sysfunc(GetOption(SYSIN));
>4 %if %length(&execpath)=0
>5 %then %let execpath=%sysget(SAS_EXECFILEPATH);
>6 %mend setexecpath;
>7
>8 %setexecpath;
>9 %put &execpath;
>
>10
>11 %put Submitted file path is %sysget(SAS_EXECFILEPATH).;
>Submitted file path is .
>12 %put Submitted file name is %sysget(SAS_EXECFILENAME).;
>Submitted file name is .
>
><snip>
>
>17 %let FileSpec=%sysget(SAS_EXECFILEPATH);
>18 %put FileSpec: &FileSpec.;
>FileSpec: