Date: Thu, 8 Aug 1996 08:45:46 +0000
Reply-To: Edel Christoph MSM PH DE <christoph.edel@DEWE.MHS.CIBA.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Edel Christoph MSM PH DE <christoph.edel@DEWE.MHS.CIBA.COM>
Subject: Re (2): Passing local macro variable to
David and Karsten,
I recently had the same problem of transferring a macro variable from the
local session to a remote session. I did not find any documentation of an
appropriate SAS feature - my SAS Connect, Usage and Reference, Version 6,
Second Edition, manual only refers to the SYSRPUT macro to handle the
reverse direction case. However, Tech Support provided me with the following
SYSLPUT macro which does exactly what David requires:
>>>>>>>>>>>>> abbreviated macro code from Tech Support >>>>>>>>>>>>>>>>>
options mstored sasmstore=LIBREF;
%macro syslput(variable = variable, /* Name of remote variable */
value = value /* Value to assign to remote variable*/
)/store;
/*Copyright stuff and development history omitted */
%let __rsub = %nrstr(rsubmit;
%%let ) %str(&variable = &value;
endrsubmit;
);
&__rsub
%mend syslput;
%syslput(variable=HUGO, value=ABC);
>>>>>>>>>>>>>>> end of code from Tech Support >>>>>>>>>>>>>>>>>>>>>>>>>>
Your local macro variable MYMACVAR will have the same value in the remote
session as in your local session if you use the macro as follows:
* *** local session: ***;
%let MYMACVAR = local session value;
%syslput(variable=MYMACVAR, value=&MYMACVAR);
* *** remote session: ***;
rsubmit;
/* remote program statements*/
* *** verify the value in the remote session;
%put NOTICE: value of MYMACVAR is: &MYMACVAR;
endrsubmit;
If you need to transfer all local macro variables, create a data set/view
from the dictionary tables (I believe you need 6.11 on your local machine
for it, but others might prove me wrong) and submit the SYSLPUT macro for
each observation from a data _null_ with the EXECUTE call routine.
Hope this helps,
Chris
>>>>>>>>>>>>>>>>>>>> the original postings were: >>>>>>>>>>>>>>>>>>>>>>
Date: Wed, 7 Aug 1996 09:18:59 -0700
From: Karsten Self <kmself@IX.NETCOM.COM>
Subject: Re: FW: Passing local macro variable to a remote site using
sas/conne
ct
Your local and remote sessions are independent processes running on seperate
machines. Macros and macrovariables reside in memory (functionally, we'll
fudge on this a bit), which is not shared between the machines.
You need to pass the macrovariables in the form of data or a text file
between the machines. You'll find the current value of macros and
macrovariables in the DICTIONARY tables -- I beleive the appropriate table
is MACRO or VMACRO depending on whether you reference the DICTIONARY (SQL)
or SASHELP (DATA Step) views. You can also use SYMGET/SYMPUT and other
mechanisms.
For information on SAS dictionary views, see Tech Report 222 (Changes &
Enhancements 6.07) and subsequent C&E documentation. Macros and
macrovariables were added in 6.08/6.09, I believe.
At 09:40 AM 8/6/96 EDT, Talan_D wrote:
>Dear SAS-L:
>
>I am running sas 6.11 on a unix platform and use SAS/Connect to logon to
>another unix platform but am unable to pass several macro variables that I
>have defined locally to the remote unix platform. I looked in the
>SAS/Connect manual for an example; and sure enough, there was an example in
>the book. I, however have not been able to get my code work like the
example
>
>in the book. Does anyone have the solution to this problem?
>
>Thank you very much,
>
>David Talan
>202-606-6534
>
>
----------------------------------------
Karsten Self / kmself@ix.netcom.com
...internet immortality achieved:
http://www.unitedmedia.com/comics/dilbert/puppets/HAMILTON.jpg
What part of gestalt don't you understand?