moodymudskipper
moodymudskipper

Reputation: 47320

Automatic parameter and definition display for macro functions in SAS EG

In SAS EG there is a neat feature that allows one to see the parameters of a macro function and its definitions when typing.

For example if I execute:

%macro test
(a /* this is a */
,b /* this is b */
);
%put a b;
%mend;

And then type %test(, a popup will show me "a : this is a" etc...

Unfortunately for some reason it seems to work only IF the macro function was defined in the current program (so basically in the only place where you don't really need it, as in that case it should be quite fresh in your mind).

Say for example I defined in another session :

options mstored sasmstore=mylib;
%macro test2
(c /* this is c */
,d /* this is d */
) / store source des='show c and d';
%put c d;
%mend;

I suppose a workaround would be to create a macro %redefine_all that would go through the catalog and execute every stored macro definition, but that's quite ugly and I'm not completely sure how I'd go at it...

Upvotes: 0

Views: 587

Answers (1)

Richard
Richard

Reputation: 27508

Sounds like a 'one of those things' thing.

The EG help "About the Program Editor" - "Using the autocomplete feature" states:

The Program Editor can also read your current program and suggest syntax for these program elements:

  • macro variables that are defined by using the %LET statement or SYMPUT CALL routine
  • macro routines that are defined by using the %MACRO statement
  • data set names that are defined by using the DATA step statement

    Note: The Program Editor does not automatically list macro variables and routines that are defined outside of the current document (for example, external macro programs, %include files, and autoexec files).

  • Upvotes: 2

    Related Questions