BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
HyunJee
Fluorite | Level 6

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"

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

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

5 REPLIES 5
FriedEgg
SAS Employee

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

art297
Opal | Level 21

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

ballardw
Super User

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.

Doc_Duke
Rhodochrosite | Level 12

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

HyunJee
Fluorite | Level 6

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!

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
  • 5 replies
  • 2280 views
  • 6 likes
  • 5 in conversation