| Date: | Sat, 30 Sep 2006 15:43:41 -0400 |
| Reply-To: | "Dorfman, Paul" <paul_dorfman@MERCK.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Dorfman, Paul" <paul_dorfman@MERCK.COM> |
| Subject: | Re: How to drop an array of variables? |
|
| In-Reply-To: | <200609301851.k8UAkoxK015985@malibu.cc.uga.edu> |
| Content-Type: | text/plain; charset=us-ascii |
Gim,
Try
drop var: ;
Or
(drop = var:)
as a data set option. Note, though, that it works only because var1-var3
have the same prefix and has nothing to do with them being incorporated
into an array. You cannot use an array name as a handle to drop all
variables it links, so if your array includes variables not sharing a
prefix, tough - you have to drop them separately. Undocumentedly, you
CAN use an array name as a handle to retain all variables (and even
assign the same value to them at compile) it ties together regardless of
whether they share a prefix or not:
Array arr [*] a b c d ;
Retain arr 1 ;
Kind regards
------------
Paul Dorfman
Jax, FL
------------
+-----Original Message-----
+From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On
+Behalf Of Gimmy Tang
+Sent: Saturday, September 30, 2006 2:52 PM
+To: SAS-L@LISTSERV.UGA.EDU
+Subject: How to drop an array of variables?
+
+
+Hi there,
+I need to drop a set of variables defined in an array. For example,
+array listname[3] var1-var3;
+...
+
+I tried both 'drop listname[3];' and 'drop listname{*};' but
+failed. Can
+anyone help?
+Thanks!
+gim
+
+
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and then
delete it from your system.
------------------------------------------------------------------------------
|