BookmarkSubscribeRSS Feed
Adzy
Calcite | Level 5

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.

4 REPLIES 4
Reeza
Super User

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?

SandorSzalma
Fluorite | Level 6

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

ballardw
Super User

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.

Rambill
Calcite | Level 5

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'.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1299 views
  • 0 likes
  • 5 in conversation