Date: Tue, 13 Jul 2010 13:47:02 +0000
Reply-To: "Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Keintz, H. Mark" <mkeintz@WHARTON.UPENN.EDU>
Subject: Re: Masking macros in rsubmit-block
In-Reply-To: <201007131055.o6DAnMae016941@malibu.cc.uga.edu>
Content-Type: text/plain; charset="utf-8"
Jesper
I don't think you can use your example as a contradictino to the statement "moving RSUBMIT/ENDRSUBMIT outside the macro iteself causes everything to work as desired". Your example didn't actually move the block outside of the macro definition of TEST.
But I did find it an interesting exposure of the difference in how the post-macro-compiled statements were treated by the local SAS interpreter (nested macro CLIENT) vs. what SAS/CONNECT client passed on to SAS/CONNECT host in macro SERVER.
Regards,
Mark
> -----Original Message-----
> From: Jesper Sahner Pedersen [mailto:jespersahner@HOTMAIL.COM]
> Sent: Tuesday, July 13, 2010 6:55 AM
> To: SAS-L@LISTSERV.UGA.EDU; Keintz, H. Mark
> Cc: Jesper Sahner Pedersen
> Subject: Re: Masking macros in rsubmit-block
>
> Hi Mark,
>
> Thanks for the reference.
>
> In the conclusion is stated: "In many cases just moving the
> RSUBMIT/ENDRSUBMIT outside the macro causes everything to work as
> desired.
> By doing this you are causing the macro itself to be complied on the
> remote
> host leaving no room for error as to what should and shouldn’t get
> remote
> submitted."
>
> In my example this doesn't hold true (maybe because of macro-nesting),
> I
> guess.
>
> Regards,
> Jesper
>
> On Tue, 13 Jul 2010 04:51:37 +0000, Keintz, H. Mark
> <mkeintz@WHARTON.UPENN.EDU> wrote:
>
> >Jesper
> >
> >If you did not embed your work in a single macro TEST, you get
> consistent
> results for CLIENT and SERVER. This made me think the problem is
> partially
> related to nested macro definitions.
> >
> >A google search for "nested macro definitions" sas
> >
> >yielded http://support.sas.com/techsup/technote/ts697.pdf (titled "The
> Relationship between SAS/CONNECT and the MACRO facility").
> >
> >Regards,
> >Mark
> >
> >> -----Original Message-----
> >> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> >> Jesper Sahner Pedersen
> >> Sent: Sunday, July 11, 2010 2:55 PM
> >> To: SAS-L@LISTSERV.UGA.EDU
> >> Subject: Masking macros in rsubmit-block
> >>
> >> Hi,
> >>
> >> According to the "SAS/Connect 9.2 Users Guide, p. 126, example 3" a
> >> macro
> >> definition embedded in a rsubmit-block is remotely submitted and
> none
> >> of the
> >> macro statements are interpreted in the client session.
> >>
> >> In the code below the client- and server-macro definitions are
> >> identical but
> >> they are interpreted differently:
> >>
> >> %macro test;
> >>
> >> %macro client;
> >> %let a=%str( );
> >> %put x&a.x;
> >> %mend client;
> >> %client;
> >>
> >> %let server=xx.xx.xx.xx xxxx;
> >> signon server user=xxxxxx password='xxxxxxxx';
> >> rsubmit;
> >> %macro server;
> >> %let a=%str( );
> >> %put x&a.x;
> >> %mend server;
> >> %server;
> >> endrsubmit;
> >> signoff;
> >>
> >> %mend test;
> >>
> >> %test;
> >>
> >> - produces the following output:
> >> x x
> >> xx
> >>
> >> - and options=mprint shows the following macro-code in the rsubmit-
> >> block:
> >> %macro server;
> >> %let a= ;
> >> %put x&a.x;
> >> %mend server;
> >> %server;
> >>
> >> In other words the %str()-statement is not masked, hence the macros
> are
> >> interpreted differently.
> >>
> >> Is this an error, or am I missing something?
> >> And if not an error, how can a macro be completely masked?
> >>
> >> Regards,
> >> Jesper
|