LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (January 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 12 Jan 2006 15:05:50 +0100
Reply-To:   Rune Runnestø <rune@FASTLANE.NO>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Rune Runnestø <rune@FASTLANE.NO>
Subject:   Using the Autocall library in SAS for storing usermade macros
Comments:   To: sas-l@uga.edu

Hi,

Two issues: 1. Where do I find the files in the default autocall library ? 2. How do I use the autocall library for storing user-made macros ?

Ad 1) An autocall library is a collection of sourse files. This can be either a directory, a PDS (partial data set) or a SAS Catalog. Macro definitions can be permanently stored in an autocall library. One advantage of autocall libraries is that you do not have to submit or include the macro definition before you submit a call to the macro.

SAS has a bunch of macros stored in autocall libraries, for instance %lowcase(argument), %qlowcase(argument), %left(argument), %trim(argument) and %datatyp(argument). How can I find those files and view the source code of those macros ? I've submitted proc options short; run; and have got this in the log: SASAUTOS= ( "!sasroot\core\sasmacro" "!sasext0\dmine\sasmacro" "!sasext0\inttech\sasmacro" "!sasext0\soltnsdata\sasmacro" "!sasext0\access\sasmacro" "!sasext0\assist\sasmacro" "!sasext0\eis\sasmacro" "!sasext0\ets\sasmacro" "!sasext0\graph\sasmacro" "!sasext0\iml\sasmacro" "!sasext0\or\sasmacro" "!sasext0\qc\sasmacro" "!sasext0\share\sasmacro" "!sasext0\stat\sasmacro" "!sasext0\scorecard\sasmacro" ) Does this tell anything where the macros reside ?

Ad 2) I have made this macro: %macro prtlast; %if &syslast ne _NULL_ %then %do; proc print data=&syslast(obs=5); title "Listing of &syslast data set"; run; %end; %else %put No data set has been created yet.; %mend;

I have saved this macro here: D:\SAS_KODE\MACROS\Prtlast.sas

Then I submit these 3 lines of code...

options mautolocdisplay; options mautosource sasautos=('D:\SAS_KODE\MACROS',sasautos); %prtlast

...this is ment to concatenate the autocall library that I create with the default autocall library in the value of the SASAUTOS system option. Otherwise, the new autocall library will replace the default or existing libraries in the value of SASAUTOS, and the autocall facility will have access to only the new autocall library.

This is the message I get in the log:

81 options mautolocdisplay; 82 options mautosource sasautos=('D:\SAS_KODE\MACROS',sasautos); 83 %prtlast - 180 WARNING: Apparent invocation of macro PRTLAST not resolved. ERROR 180-322: Statement is not valid or it is used out of proper order.

When I resubmit...

proc options short; run;

...I get an entry in addition to the one shown above:

SASAUTOS=('D:\SAS_KODE\MACROS',sasautos)

Obviously, my attempt to extend the the autocall library failed. Does anyone have a suggestion how to do it ?

Rune


Back to: Top of message | Previous page | Main SAS-L page