sas icon indicating copy to clipboard operation
sas copied to clipboard

using autoexec file with build

Open cara499 opened this issue 8 years ago • 5 comments

Can you use autoexec files with SAS.sublime-build? I have a file called autoexec.sas in the working directory, but when I run the build SAS is not reading it.

cara499 avatar Nov 21 '17 16:11 cara499

As written the package sets -SASINITIALFOLDER to the same dir as the submitted program. So if you've got \bibbity\bobbity\boo.sas open & you hit build, SAS should look for a \bibbity\bobbity\autoexec.sas to run first. Is that not the behavior you're seeing? Or is that what you're seeing & you'd rather it did something else?

rpardee avatar Nov 21 '17 17:11 rpardee

This is not what I'm seeing. When I hit build, SAS does not look for an autoexec file in the same directory as the program I'm running. See directory listing and log file below.

dirlist

log

cara499 avatar Nov 21 '17 20:11 cara499

Hi,

I'm also having the same issue where the autoexec.sas file is not being read from the current working directory.

apatel9437 avatar Jan 31 '18 20:01 apatel9437

Sorry to take so long to look at this. I confirm the behavior & it is a bug. I'm not sure why the SASINITFOLDER specification on the command line isn't working.

If I manually submit the very same command-line that sublime's python environment builds up in a cmd or powershell window it works fine. But for some reason when python shells out with that command everything works but sasinitfolder.

I'm afraid I'm stumped on this one. I'll leave this issue open in case inspiration strikes me (or anyone) but I fear this is not going to fixed.

Sorry.

rpardee avatar Oct 23 '18 15:10 rpardee

If I'm reading this right, on windows that command-line option only affects where the file open & save dialog boxes start out: image Which is of course of no use for batch submitters like the users of this package.

Reading the linked doco on how SAS determines the current folder when SAS starts, I think this could be overcome by

  • Adding the dir in which SAS.exe is found to your %PATH%, and
  • Removing that dir from this packages' preferences (Preferences -> Package Settings -> SAS -> User settings.) (So--the setting should just be "sas.exe")

I'd be interested to hear if this works for anyone, if anybody's still paying attention to this (am not in a good position to test it myself).

rpardee avatar Sep 05 '22 18:09 rpardee