DATA Step, Macro, Functions and more

macro timing - error - The macro C is still executing and cannot be redefined.A dummy macro will be compiled.

Reply
Contributor
Posts: 60

macro timing - error - The macro C is still executing and cannot be redefined.A dummy macro will be compiled.

Hi.

I've got problem apparently with some macro execution timing.

I've got macro A from which I execute macro C in a loop %do %while%.

I need to assure that macro C finished executing in iteration n before executing macro C in iteration n+1.

Now I get errors:

Line 696: ERROR: The macro C is still executing and cannot be redefined.

Line 697: ERROR: A dummy macro will be compiled.

and in the log i see that some iterations of macro C did not start at all.

Is there a way to force SAS to woit for macro execution?

Thanks for help.

Super User
Super User
Posts: 6,499

Re: macro timing - error - The macro C is still executing and cannot be redefined.A dummy macro will be compiled.

Sounds like you have code like:

%macro a;

  %macro c;

  %mend c;

  %c;

%mend a;

Move the definition of macro c outside of the definition of macro a.

%macro c;

%mend c;

%macro a;

  %c;

%mend a;

Contributor
Posts: 60

Re: macro timing - error - The macro C is still executing and cannot be redefined.A dummy macro will be compiled.

i have;

%macro c;

%mend c;

%macro a;

     %do %while ...

     %c;

    

     

     %end;

%mend a;

Super User
Super User
Posts: 6,499

Re: macro timing - error - The macro C is still executing and cannot be redefined.A dummy macro will be compiled.

Next suspect is unbalanced quoting.  Try starting SAS fresh.  Does the macro A work the first time it is called?

Does it matter the values that are passed to it?

Ask a Question
Discussion stats
  • 3 replies
  • 2661 views
  • 0 likes
  • 2 in conversation