Hi All,
I've been doing some work which involves submitted rsubmit commands through a local macro. I've re-read the excellent paper from SAS explaining the matter (
The Relationship between SAS/CONNECT and the MACRO Facility), but I have an outstanding question:
When I run the following code, everything works as expected:
[pre]%macro m;
%let n = L;
%put &n;
%syslput n = R; /* 1 */
rsubmit; /* 2 */
%nrstr(%put &n.);
endrsubmit;
%mend m;
%m;[/pre]
&n resolves to L when checked locally, and R when checked remotely.
If I swap rsubmit and %syslput lines (marked 1 and 2) however ...
[pre]%macro m;
%let n = L;
%put &n;
rsubmit; /* 2 */
%syslput n = R; /* 1 */
%nrstr(%put &n.);
endrsubmit;
%mend m;
%m;[/pre]
... &n is no longer assigned a value on the remote host.
It seems to me that since the %syslput statement is exectuted in the local session, and that it would be available to the following %nrstr(%put) line, but apparently not!
I assume I'm missing something about either the compile/execution order or the interaction between rsubmit and the rest of the macro.
Could some kind soul explain just what I've missed?
Thanks,
-- Will