| Date: | Tue, 17 Nov 1998 15:02:56 -0600 |
| Reply-To: | hwang@ZSASSOCIATES.COM |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | hongjie Wang <hwang@ZSASSOCIATES.COM> |
| Subject: | macro question |
| Content-type: | text/plain; charset=us-ascii |
|---|
Dear friends, I try to use macro to hide a rather complex datastep
function.
In doing so, I have tried three different ways, which I thought were
equivalent. But they are not.
I hope someone can help me out.
For instance, (assume that we do not have a SAS function sin(x).)
%macro func1(x, y);
y=sin(&x);
%mend;
%macro func2(x);
%put z=sin(&x);;
%mend;
%macro func3(x);
%put sin(&x);;
mend;
data one;
x=1;
%func1(x,z);
run;
data one;
x=1;
%func2(x);
run;
data one;
x=1;
z=%func3(x);
run;
Only the first method works as I expected.
I hope you would give me some insights! Thanks!
|