DATA Step, Macro, Functions and more

Call Execute that calls a macro with call symput does not work

Reply
N/A
Posts: 0

Call Execute that calls a macro with call symput does not work

Hello

I have created a series of sas macros that I wrapped inside of a macro called: %process.

%extract(card=&card);
%merge(card=&card);

The macro %merge generates a sas dataset No 001. that creates a series of macro array variables using call symput. The macro variables are used in the next data step no 002. that is being generated. The array variables are used to generate sas statements.

If I remote submit all of the macro defintions and call %process directly it works perfectly.

If I call macro %process from a data step using call execute, then the call symput statements do not generate the macro variables and the 2nd data step does not get the generated sas statements.
N/A
Posts: 0

Re: Call Execute that calls a macro with call symput does not work

Posted in reply to deleted_user
But if the macros are creating datasteps themselves then surely calling the macro from within another datstep will not work. I'm not quite sure what you are trying to do here. Could you maybe post a bit more code?
Super Contributor
Super Contributor
Posts: 3,174

Re: Call Execute that calls a macro with call symput does not work

Posted in reply to deleted_user
Also, consider the presence or lack of a RUN; statement within each macro will have an impact on whether your SYMPUT SAS macro variables are GLOBAL or LOCAL.

Check the SAS MACRO documentation link below on this topic, as well as other SAS support website http://support.sas.com/ technical reference material on the topic.

Special Cases of Scope with the CALL SYMPUT Routine
http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/tw3514-symput.htm

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Call Execute that calls a macro with call symput does not work

Posted in reply to deleted_user
I found the doc... You can not use call execute to call a sas macro that has call symput statements in the generated data step code.
Ask a Question
Discussion stats
  • 3 replies
  • 161 views
  • 0 likes
  • 2 in conversation