Date: Tue, 12 Feb 2002 05:17:45 -0800
Reply-To: Tim Braam <timothy.j.braam@CENSUS.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tim Braam <timothy.j.braam@CENSUS.GOV>
Organization: http://groups.google.com/
Subject: Re: How to pass the values of a field in a dataset to.........?
Content-Type: text/plain; charset=ISO-8859-1
Amy,
Try this:
data _null_;
set test end=last;
call symput('state'||left(put(_N_,2.)), trim(state));
if last then call symput('numstate', left(put(_N_,2.))) ;
run;
%macro create_html;
%do i =1 %to &numstate ;
ODS html body="&&state&i...htm" ;
Proc print data=test(where=(state="&&state&i")) NOOBS split='!';
VAR storename sale;
RUN;
ODS HTML close;
%end ;
%mend;
%create_html ;
Tim Braam
US Census Bureau
amywang11790@yahoo.com (amy) wrote in message news:<63a65d31.0202111853.34db0cb1@posting.google.com>...
> Hello, all,I intent to generate one html for each value of state
> (NY,CA.....) in the dataset.so I coded as the following, it does not
> work. (I am new to macro. :)
>
>
> %macro create_html(p_state=);
> ODS html body="&p_state.htm" ;
> Proc print data=test NOOBS split='!';
> VAR storename sale;
> where state=&p_state;
> RUN;
> ODS HTML close;
> %mend;
>
>
> data _null_;
> set test;
> call symput('m_state', state);
> %create_html(p_state=&m_state);
> run;
>
> test dataset is like:
> state storename sale
> ny a1 100
> ny a2 110
> ca b1 120
> ...
>
> How can I do it? Thanks in advance for any inputs.
>
> Amy
|