Date: Fri, 15 Dec 2006 11:20:42 +0100
Reply-To: Stéphane COLAS <scolas@DATAMETRIC.FR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Stéphane COLAS <scolas@DATAMETRIC.FR>
Subject: Re: query on marco variable
In-Reply-To: <1166177528.608657.108750@n67g2000cwd.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
This code works because call symput stays on the same step than the array
statement.
data test1;
array locT{10};
call symputx('Num_T', dim(locT));
run;
%put num_t=&num_t;
Stéphane.
Selon zenny <pengz.q@GMAIL.COM>:
> Dear Mogens,
>
> Thanks for your replying! But maybe I did make it clear. What I want is
> to use a macro variable to save the length of a temporary array. but
> the dim function doesn't work.
>
> data test1;
> array locT{10};
> run;
>
> data test2;
> set test1;
> call symput('Num_T', dim(locT));
> run;
>
> Thanks&Regards,
> Pengz
>
> "Mogens A. Krogh дµÀ£º
> "
> > Dear Pengz.P,
> > This datastep count the number of numeric variables in sashelp.class
> > and assign the value to the macro variable Num_Pil.
> >
> > Was that what you wanted??
> >
> > data _null_;
> > set sashelp.class (obs=1);
> > array pil(*) _numeric_;
> > call symput('Num_Pil',dim(pil));
> > run;
> >
> > Regards,
> > Mogens A. Krogh
> > www.kvl.dk
> >
> > pengz.q@gmail.com skrev:
> > > Hello, I am tring to assign the length of the array to a macro
> > > variable, but failed. Could anybody tell me how to do that? Thanks!
> > > This is what I get, try to use %sysfunc but no help.
> > >
> > > data _null_;
> > > array locT{10};
> > >
> > > %let num_T=dim(locT);
> > > %put &num_T;
> > > run;
>
|