Architecting, installing and maintaining your SAS environment

Opening a sas file when starting up SAS

Reply
N/A
Posts: 1

Opening a sas file when starting up SAS

Hi All,

Is it possible to configure SAS to open up a .sas file when starting up SAS so that it displays the code (as opposed to running code when opening SAS)? We're creating SAS templates (Header, layout, etc.) that we want to be visible to users when they open SAS.

Super User
Posts: 19,855

Re: Opening a sas file when starting up SAS

Do you mean rather than open up to a blank editor it should open up a template file that contains header/layout that a programmer should follow?

Could you add that into the autoexec maybe?

Contributor
Posts: 27

Re: Opening a sas file when starting up SAS

Hi Adzy,

you should change the default action assigned to the .sas files.

Default action is actually not defined during the SAS installation so the first one (Batch903) is taken.

\HKEY_CLASSES_ROOT\SAS.Program.701.shell

(Default): (no value) --> OpenwithSAS903

Regards,

Sándor

Super User
Posts: 11,343

Re: Opening a sas file when starting up SAS

A line like

 

dm "fileopen 'd:\data\autoexec.sas' ";

as the last line in your autoexec.sas file should work. The filename will need a full path in quotes.

Occasional Contributor
Posts: 7

Re: Opening a sas file when starting up SAS

If your need is to open a SAS script during Base SAS startup, create a SAS script with the name autoexec.sas and place it at

'C:\Program Files\SAS\SAS 9.1' if 9.1.3 and or on the home directory of the version installed. SAS will automatically pick it up.

To check the default autoexec location, use proc options option=autoexe;run;

You can also add this autoexec option in the C:\Program Files\SAS\SAS 9.1\nls\en\sasv9.cfg'.

Ask a Question
Discussion stats
  • 4 replies
  • 495 views
  • 0 likes
  • 5 in conversation