BookmarkSubscribeRSS Feed
skipper
Calcite | Level 5

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?

7 REPLIES 7
ballardw
Super User

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.

SASKiwi
PROC Star

Try creating an autoexec.sas program that will automatically run when SAS starts and in this program have the statement:

DM 'include "mysasprogram.sas" ';

Peter_C
Rhodochrosite | Level 12

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

Ksharp
Super User

You can directly double-click this myprogram.sas file ,and SAS will open it for you defaultly.

Peter_C
Rhodochrosite | Level 12

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

Ksharp
Super User

Sorry.

My SAS9.2 is under WinXP ,WinXP is too old I know. I can open the sas code easily.

Andre
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1750 views
  • 0 likes
  • 6 in conversation