Date: Thu, 12 Jan 2006 15:15:12 +0100
Reply-To: Alte@uni-greifswald.de
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dietrich Alte <Alte@UNI-GREIFSWALD.DE>
Organization: IES, EMAU HGW
Subject: Re: Using the Autocall library in SAS for storing usermade macros
In-Reply-To: <Gp-dnVEVRL3S_1veRVnzvA@telenor.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Rune,
try adding STORE in the first line of macro definition:
%macro prtlast STORE;
from SASHELP:
"STORE: stores the compiled macro as an entry in a SAS catalog in a
permanent SAS data library. Use the SAS system option SASMSTORE= to
identify a permanent SAS data library. You can store a macro or call a
stored compiled macro only when the SAS system option MSTORED is in
effect. (For more information, see Storing and Reusing Macros.)"
hth
Dietrich
Rune Runnestø schrieb:
> 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
>
>
>
>
--
----------------------------------------------------------------
DIETRICH ALTE, Dipl.-Statistiker, Dr. rer. med.
Institut für Epidemiologie & Sozialmedizin
--> Studien-Management "Study of Health in Pomerania (SHIP)"
EMA-Universität Greifswald - Medizinische Fakultät
Walther-Rathenau-Str. 48, D-17487 Greifswald, Germany
URL www.medizin.uni-greifswald.de/epidem/
Phone ++49(0)3834-867713, Fax ++49(0)3834-866684
----------------------------------------------------------------
|