Date: Thu, 22 Dec 2005 14:44:48 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Macro generated SAS codes in LST file.
In-Reply-To: <1135229641.475197.157330@g49g2000cwa.googlegroups.com>
Content-Type: text/plain; format=flowed
Jagadishkr,
To answer your question no there isn't. Mprint and/or Mfile is the closest
and that will only echo your SAS code in the log not the listing. You could
do this but it would be a pain in the neck to actually develope every macro
this way. You would have to write the code such that you load the data step
code into either a data set as data and print it.
data one ;
x = 1 ;
Y = 'A' ;
run ;
%macro test(DSN = ) ;
data __Junk ;
length Text $50 ;
Text = "proc print" ;
output ;
Text = " data = &DSN ;" ;
output ;
Text = "run ;" ;
output ;
run ;
proc print
data = __Junk noobs ;
run ;
proc print
data = &DSN ;
run ;
proc datasets ;
delete __Junk ;
run ;
%mend ;
%test( DSN = One )
Toby Dunn
From: jagadishkr@GMAIL.COM
Reply-To: jagadishkr@GMAIL.COM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Macro generated SAS codes in LST file.
Date: Wed, 21 Dec 2005 21:34:01 -0800
Hi All,
Wish you a merry christmas and happy new year.
Well, Just wondering !! Is there any way to view all macro generated
SAS codes in LST (Output) file ? I want users to view the sas codes
before the output of each code.
For example,
%macro x(Dset=,amt=);
proc print data=&Dset;
where amount>=&amt;
run;
%mend;
%x(Dset=Foo,Amt=1000);
In lst file we should have some thing like below,
SAS Code:
PROC PRint data=Foo;
where amount >= 1000;
run;
Output:
******** Output of proc print should come here ***************
I appreciate your help here.
Thanks,
Jagadish