every time I open SAS i have to press 'Ctrl+s' and then browse to the file with my sas code file, press open and it pops up in the editor window.
My question is.
Is there a way to do this auto, like the default start-up file?
Is it the same file every time? Or the last one used? Do you want it to run on open or not?
Also you may want to try going to Tools> Options > Preferences > General and make sure that the 'Recently used file list' box is checked. And set a number in the box below immediately below for how many files you want to have available (I use 25). Then clicking on the File menu will bring up the recently used list where you can select a file, which should at least save time.
Try creating an autoexec.sas program that will automatically run when SAS starts and in this program have the statement:
DM 'include "mysasprogram.sas" ';
there is an option you can specify before SAS starts
-initcmd 'wedit "your sas program path\file.sas" '
specify it
on the command line
or
in a config file
or
in user environment variable sas_options
For simplicity, I start SAS with no options, but specify that the folder in which it starts is my preferred place and there I create an empty sasv9.cfg file into which I would place that -initcmd option
You can directly double-click this myprogram.sas file ,and SAS will open it for you defaultly.
Ksharp
are you running SAS in Win7?
I run SAS on winVista32 which still suffers from the "old problem" caused by microsoft ole automation server. That handles the launching of registered file types and sets the "current folder" where SAS will start, as windows\system32! I cannot normally write there, and I support legacy code which expects the current folder to be "writeable" (for example, to write a .log or .altlog file).
If you are running SAS on win7, with your proposal "double-click this myprogram.sas file ,and SAS will open it for you defaultly", does the SAS session start in the folder of "myprogram.sas" or in the windows\system32 folder or somewhere else?
peterC
Sorry.
My SAS9.2 is under WinXP ,WinXP is too old I know. I can open the sas code easily.
Peter,
I can test it on my pc W7 32b with 9.3.0 and
if i modify the config file in nls\en to neutralize both
the -set MYSASFILES and the eventual -SASINITIALFOLDER
when i go starting from D:\tabsas
and rightclic on the item "open with sas 9.3" (sorry the double clic is acting with the sas universal viewer 1.2)
the program is opening in the enhanced pgm editor
indicating down at the limit the directory D:\tabsas\
THEN
only seeing File / opening a program shows that it is located at ....My SAS Files\9.3\ d:\... in my case
and
only seeing File /save as show a location at d:\tabsas\
in the reverse order yet only seeing but not acting on a button
File / the save shows d:\tabsas\
and then File / opening a sas program shows d:\tabsas\
a discovery for me ! so the sequence you are opening items of the File Menu have effects!!!!
Andre
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.