Help using Base SAS procedures

Creating and using autoexec and config files

Accepted Solution Solved
Reply
Contributor
Posts: 71
Accepted Solution

Creating and using autoexec and config files

I am needing to create some autoexec and config files for a program I am working with in SAS. The instructions say to create autoexec.sas and config.sas files to fingure the SAS session and automatically load the application.  I created two SAS programs with my config and autoexec code, but I keep gettting errors whenever I try to run the below coding. I have never had to create or use autoexec.sas and config.sas files previously and appreciate any help you can provide. Thank you.

HyunJee

-config "S:\GenPeds\GenPeds\JHale\DualData\test_config.sas"

-autoexec "S:\GenPeds\GenPeds\JHale\DualData\test_exe.sas"


Accepted Solutions
Solution
‎12-08-2011 05:12 PM
PROC Star
Posts: 7,356

Creating and using autoexec and config files

Expanding on FriedEgg's comment, both the config and autoexec files are text files.  You can read about them at: http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#a000104286.htm

View solution in original post


All Replies
Trusted Advisor
Posts: 1,300

Creating and using autoexec and config files

config files are not sas code, it is a file that contains, basically, a list of session options (and multi-line comments).

Solution
‎12-08-2011 05:12 PM
PROC Star
Posts: 7,356

Creating and using autoexec and config files

Expanding on FriedEgg's comment, both the config and autoexec files are text files.  You can read about them at: http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#a000104286.htm

Super User
Posts: 10,466

Creating and using autoexec and config files

If the Config.sas, or as with version 9, SASV9.CFG file actually needs to be modified, then there is something that only takes effect on startup. So you can't actually execute those files in a runnings session. It's been awhile since I played around with some of this but it may be that you want to create an additional shortcut to SAS, or a batch file that starts a SAS session, and point to those files.

For examle my Windows desktop icon in the properties shows the following in the Target section.

"C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe" -CONFIG "C:\Program Files\SAS\SASFoundation\9.2(32-bit)\nls\en\SASV9.CFG"

If you have a shortcut, copy it and replace the existing similar with the new config file path.

Instead of the autoexec parameter you could add the line:

-autoexec="S:\GenPeds\GenPeds\JHale\DualData\test_exe.sas"

to that configuration file. Note that this form as an equal sign.

Trusted Advisor
Posts: 2,113

Creating and using autoexec and config files

HyunJee,

In addition to the earlier comments, you would almost never need to create a config.sas file from scratch.  You may need to modify it, but even that can generally be accomplished in code or in the autoexec.sas file.  The autoexec.sas file is just SAS code that is prepended to each SAS batch program or interactive session; you could accomplish the same endpoint by inserting the code or using a %INCLUDE statement at the front of a program.  The reference that Art provided is quite useful.

We've pretty much exhaused the possible answers to the question that you have asked.  The underlying question of "why" you think that they need modification has not been asked.

Doc Muhlbaier

Duke

Contributor
Posts: 71

Creating and using autoexec and config files

Doc,

The "why" is that I am trying to use a program that was written several years ago called 'DualData'. In the instructions it stated to create your own autoexec and config files but did not state the reasoning as to why. I wanted to make sure I could try and understand the purpose of the two files and how they worked in SAS.

To all:

I appreciate everyone's feedback!

Art: the link you provided was very useful.

Thank you everyone!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 351 views
  • 6 likes
  • 5 in conversation