LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (December 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: zenny <pengz.q@GMAIL.COM>
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; >


Back to: Top of message | Previous page | Main SAS-L page