Date: Thu, 18 May 2000 08:02:24 GMT
Reply-To: Richard Parfitt <RParfitt@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Richard Parfitt <RParfitt@HOTMAIL.COM>
Organization: Deja.com - Before you buy.
Subject: Re: SAS/CONNECT Macro Variable Problem
John,
Thanks for that, I had not originally thought of RSUBMIT blocks in
quite those terms, but doing so certainly helps me! I believe the only
solution I can use in my circumstances is to have a macro within the
RSUBMIT block as well, which forces the resolution in the correct
place, since the remote machine compiles that macro. This is fiddly,
but at least is works.
BTW, %sysrput also works in 6.12, and the SI macro %syslput does the
reverse quite efficiently (although I wasn't impressed by the use of
options nosource!).
Thanks also to Charles, Nancy and everyone else for your help with
this. SI help haven't found a solution yet, so you all beat them to it!
Richard.
In article <8fv31r$4ao$1@nnrp1.deja.com>,
John M. Wildenthal <jmwildenthal@my-deja.com> wrote:
> In article <8frjur$4ad$1@nnrp1.deja.com>,
> Richard Parfitt <RParfitt@hotmail.com> wrote:
> > Hi, can anyone help me with a problem highlighted in the code below?
> >
> > %macro test;
> > rsubmit;
> > %global word word2;
> > %let word=boo;
> > %let word2=;
> >
> > data _null_;
> > word = symget('word');
> > call symput('word2','boo too');
> > run;
> >
> > %put WORD: &word;
> > %put WORD2: &word2;
> > endrsubmit;
> > %mend test;
> > %test;
> >
> > The log indicates (see below) that the 2 %put functions are firing
> > before the data step, so WORD2 resolves as blank. If run outside of
a
> > macro, however, WORD2 resolves correctly. Also, if run in a macro
but
> > without the RSUBMIT, WORD2 resolves correctly. Therefore, can I
force
> > the resolution of a macro variable to be runtime?
> >
> > NOTE: Remote submit to SERVER1 commencing.
> > WORD: boo
> > WORD2:
> > 2232 data _null_;
> > 2233 word = symget('word');
> > 2235 call symput('word2','boo too');
> > 2236 run;
> > NOTE: DATA statement used:
> > real time 0.010 seconds
> > cpu time 0.012 seconds
> >
> > NOTE: Remote submit to SERVER1 complete.
>
> You should think of an RSUBMIT block as being a group of statements
> that are compiled before sending, something like being within a step
> boundary. SAS evaluates all of the macros within the RSUBMIT block
> before actually sending them over.
>
> Values existing in the Remote session can be transferred to the Local
> session by using %SYSRPUT. I know it is available in v7 and v8, but
> don't know about earlier versions. If you need to send macro values
to
> the remote session, one method is to write a DATA _NULL_ that outputs
> a .sas file that will be included by the remote session.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
|