06-27-2014 10:24 AM
I have created an autoexec file in the same directory when I store my signon_to_sasgrid1.sas. When I launch a new SAS session, i have to manually open the signon_to_sasgrid1.sas to enter my log in credentials. How do I trigger the autoexec to run and open signon_to_sasgrid1.sas automatically when I launch a new SAS session?
08-22-2014 04:46 PM
Thank you RichardinOz.
I added the %include "signon_to_sasgrid1.sas" to my autoexecs.sas. When I launch SAS I am still not automatically prompted to enter my login credentials. So what I do is I run autoexec.sas and it runs signon_to_sasgrid1 which prompts me to enter my login credentails. What am I missing?
08-22-2014 05:09 PM
How are you running SAS? If you open a command windows and move to the directory with the program and launch SAS by issuing a command from the command line it should find the autoexec.sas file in the current directory. But with Windows the style is to launch SAS by clicking on an ICON. In that mode how does the icon know what directory to look for the autoexec file? Or it is even possible that you have already specified some other location for the autoexec file in the command line options or the config file that you are using to start SAS.
08-23-2014 02:20 AM
The current dir can be set by using SAS(R) 9.3 Companion for Windows SASInitialfolder. There are interactions that are giving not a good feeling as of this note: 51194 - When you use SASINITIALFOLDER options in a SAS® program that resides on the network, you mig... . The Unc namings are not reliable and causing effects.
Normally it is a bad idea coding plain userid and password in some code. There are better approaches to have them not hard-coded.
Some of those methods are requiring preparations in an autoexec. I would expect IT department delivering that as a service to you.
I hope you are not working with user=kevin password=qwerty123 with a yellow-stickynote attached at your desk.
08-23-2014 03:33 AM
How do you launch your first SAS session?
Is it SAS Enterprise Guide, "fat client" SAS (display manager), or by double clicking an icon in windows?
Each of these cause different challenges to achieve what you seek.
If it is from a windows icon, check the "start in" folder defined for the icon.
that is where your first SAS session would look for autoexec by default. Of course the launch command could redirect the -autoexec to somewhere else for some other file.
The -sasInitialFolder directs a SAS session dialog box where to start looking for programs.
none of your examples show a path on the %include - it is one way to direct that file include
In a sas session launched by SAS Enterprise Guide, many of the familiar assumptions about our (fat client) SAS session are very "broken". The major issue is for those who share a SAS server. Probably paths and permissions are quite different between the client interface environment and the server-side sas session.
08-25-2014 10:18 AM
Thank you guys for your replies.
I launch SAS from a Windows icon. This is the first line in my autoexec:
%include "C:\My Documents\My SAS Files(32)\9.3\signon_to_sasgrid1.sas"
If I open the autoexec.sas and click run, it starts signon_to_sasgrid1.sas and prompts me to log in. But I can't get autoexec to start automatically. Where is the "start in" folder?
Thank you guys again!
08-25-2014 10:30 AM
Open the properties for your Windows icon/shortcut. It has a Start in field.
Another option is to an -autoexec "search path to your autoexec" to your SAS command ("Target" in the properties window).
08-25-2014 10:32 AM
KevinC See the remark of Tom as you are pushing on an icon thee is no sasinitialfolder logical defined it can be everywhere the installer gay has decided.
Whe you create your own shortcut you can do that. ....
08-25-2014 11:37 AM
You could also just put the autoexec.sas file into whatever folder the ICON is using.
Put your autoexec code into the program editor.
Issue the command file 'autoexec.sas' from the command line.