Date: Tue, 25 Oct 2005 17:43:08 -0400
Reply-To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject: Re: hash: perl verus SAS
Kevin Roland Viel wrote:
> It seems that the SI implementation of a hash differs from that of
> perl in that the key may be composite and there may be numerous
> satellite values without manipulation of the hash value. Is this
> correct?
>
> Thanks,
>
> Kevin
In Perl the hash more easily conceptualized as Name/Value pairs, in SAS the
terms are Key/Data
The satellite feature is essentially hash an anonymous array allocated at
runtime.
To have a satellite feature of SAS in Perl, you can use a library such as
Tie-Hash-MultiValue.
The composite key feature would be emulated in Perl by doing a binary
concatenation of the sub-keys to construct a composite key.
SAS has the nice feature that when .find() is successful the anonymous array
entries of the data are copied to the PDV.
Perls hash is nice because it is a syntatic feature of the language, in SAS
hashing is a methodic feature of an object (but still very nice).
--
Richard A. DeVenezia
http://www.devenezia.com/