[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: reset an array
From:       "Dorfman, Paul" <Paul.Dorfman () BCBSFL ! COM>
Date:       2001-05-31 20:24:36
[Download RAW message or body]

Mike,

There is *another* way of doing it. It may or may not be better than plain
iteration depending on the SAS version (8 is preferred) and / or the array
dimension and the length per element if character. Look for the post
'Initializing an array' in the listserv search facility, you will find
details. Basically, you can organize an en masse move using CALL POKE
routine.

I've asked an R&D birdie to let us initialize arrays as simply as
<ARRAYname> = <expression>, just like it is done in PL/I, and he even
admitted that it would not be difficult, but have no clue about the destiny
of the request so far.

Kind regards,
=======================
Paul M. Dorfman
Jacksonville, Fl
=======================

-----Original Message-----
From: Schulingkamp, Michael E [mailto:michael.e.schulingkamp@LMCO.COM]
Sent: Thursday, May 31, 2001 3:20 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: reset an array


I was looking for the best way to reset all the elements in an array (both
permanent and temporary ones).  I've been using a "do" loop to get this done
but I thought there might be a more efficient way of doing this.  Here's
what a sample of what I've been doing:

do i=1 to dim(array);
  array{i}=' ' ;
end;

Any better ideas?

Thanks,
Mike



Blue Cross Blue Shield of Florida, Inc., and its subsidiary and
affiliate companies are not responsible for errors or omissions in this e-mail \
message. Any personal comments made in this e-mail do not reflect the views of Blue \
Cross Blue Shield of Florida, Inc.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic