- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
HI,
I would like to use SAS Autos in SAS 9.4 desktop version.
So i am unable to do it.
Can anyone help me how to use SAS Autos in SAS desktop version. By giving some example.
Thank you in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That depends on the structure you choose to implement. If you want a macro in each its own area, then yes (but with comma between them). Or you could put all your macro text files in one directory (most people do this), and then just supply that directory. So if for instance you have 3 macros:
freq.sas
print.sas
run.sas
And want to indlue those in sasautos, then you can put them all in one directory, for example c:\mymacros, and just include that:
options sasautos=("c:\mymacros");
This will make all three files available to the code. Or you could put each of those macro files in separate directories, but then your sasautos would need to refer to each folder, hence why most just put all files in one folder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000543537.htm
"So i am unable to do it." - this does not tell us anything. You simply set the option to point to the path where macro files are located.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have read your document but still there i am facing few issues as whatever small macro i am writing it is stored in Work library.
But as we use Libname statement to our own permanent library so for this how to create and store it.
and later on there was one option given SASAutos ( filepath);
i just want a sample example to understand it much better.
Hope you understand my point of view.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Show us what you are doing.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am sorry, no I have no idea. To use sasautos, you save macros as text files in a given network location, for instance c:\mymacros. You then reference this network location in your sasautos:
options sasautos=("C:\mymacros");
You can of course use libnames as well if you prefer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In case of Single macro.
options sasautos=("C:\mymacros"); * This worked;
And if i want to use more macros then i should use it in this way please correct me if i am wrong.
options sasautos=("C:\mymacros\Test_print"
"C:\mymacros\freq"
"C:\mymacros\quant");
Thanks a lot for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That depends on the structure you choose to implement. If you want a macro in each its own area, then yes (but with comma between them). Or you could put all your macro text files in one directory (most people do this), and then just supply that directory. So if for instance you have 3 macros:
freq.sas
print.sas
run.sas
And want to indlue those in sasautos, then you can put them all in one directory, for example c:\mymacros, and just include that:
options sasautos=("c:\mymacros");
This will make all three files available to the code. Or you could put each of those macro files in separate directories, but then your sasautos would need to refer to each folder, hence why most just put all files in one folder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot.
This worked as i have used multiple macros.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Bhavanaa wrote:
HI,
I would like to use SAS Autos in SAS 9.4 desktop version.
So i am unable to do it.
Can anyone help me how to use SAS Autos in SAS desktop version. By giving some example.
Thank you in advance.
What I have currently implemented for my "desktop version", SAS Display Manager or "Base SAS" is
1) modified the sasv9.cfg file, which in my install resides in : C:\Program Files\SASHome\SASFoundation\9.4\nls\en
to use an AUTOEXEC.SAS file by adding a line similar to:
-AUTOEXEC "C:\path\autoexec.sas"
2) create your autoexec.sas with code you want and place it in the location supplied in the sasv9.cfg file.
The autoexec.sas contains code that is executed on start up.
3) include a line similar to:
options insert=(SASAUTOS = ("C:\path"));
Using INSERT adds your location to the beginning of the list of locations that SAS uses for its internal macro search path. This means if you have a macro the same name as one of the SAS supplied macros yours is found first. You could use APPEND instead to place at the end of the macro search path.
4) In the folder referenced in the options statement above each of your macros must have a file matching the name of the macro the only code should be the actual macro definition. One macroname.sas file for each macro.
I go through the bit of using an autoexec file as it provides a single point for setting up a moderate number of options that I want every time SAS starts. Otherwise you just need the proper OPTIONS statement executed before the first macro call. But be careful of not using the insert or append option as you may disable some of the SAS supplied macros.
If you poke around in the sasv9.cfg you will find the base definition of the SASAUTOS paths and may be surprised at how many locations are already involved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It's not that easy to understand. And sasv9.cfg file. exe file i dont know from where to install.
Thanks a lot for your reply.
Regards,
Bhavana
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Depending on the way you work with SAS (locally on a PC with Display Manager, Enterprise Guide with the "Local" server, Enterprise Guide or SAS Studio with a remote workspace server), you have configuration and startup files that control SAS behaviour at startup. If you want to automate things so that they are automatically done when a SAS session starts, you need to get a grasp on your environment and the files involved.
If it's OK for you to set the SASAUTOS option "manually" every time you run your code, then you don't need to worry about all that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Bhavanaa wrote:
Hi,
It's not that easy to understand. And sasv9.cfg file. exe file i dont know from where to install.
Thanks a lot for your reply.
Regards,
Bhavana
Everything I mentioned are TEXT files that you edit in place or in the case of the autoexec.sas create as you would any other program.
No EXE was mentioned, nothing to install.