Date: Thu, 21 Mar 2002 11:21:47 -0500
Reply-To: kviel <kviel@GMCF.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: kviel <kviel@GMCF.ORG>
Subject: Re: set list of 'mixed' variables to missing
Content-Type: text/plain; charset="iso-8859-1"
Annette,
Perhaps this bit of code will shed some light. If you know the
variable order, which you can easily obtain from the CONTENTS procedure,
then you can employee your scheme for replacing values with missing. By the
way, a blank corresponding to a missing character value.
305 data _null_;
306 a="One"; b="Horse";
307 x=1;y=2;z=3;
308 array numer (*) _numeric_;
309 array charact (*) _character_;
310 dim_num=dim(numer);
311 dim_cha=dim(charact);
312 put dim_num= dim_cha= numer(dim_num-1)= charact(dim_cha)=;
313 var=vname(charact(1));
314 put var=;
315 run;
dim_num=3 dim_cha=2 y=2 b=Horse
var=a
NOTE: DATA statement used:
real time 0.05 seconds
cpu time 0.00 seconds
Regards,
Kevin
Kevin Viel
Georgia Medical Care Foundation
57 Executive Park South, NE
suite 200
Atlanta, GA 30329-2224
-----Original Message-----
From: Annette [mailto:anne5432@UNI.DE]
Sent: Thursday, March 21, 2002 9:52 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: set list of 'mixed' variables to missing
hello,
However, I am to set to missing selected mixed (num, char) vars (e.g. VAR,
ANIMAL, and
TEXT) in selected rows (by ID). I guess some ARRAY would be convenient, but
my efforts were not uccessful until now. The data set contains hundreds of
character and numeric vars. The idea is this:
old:
ID TEST VAR ANIMAL TEXT TAPE
1 1 7 3 dgffg hghg
2 7 4 2 hghf hhh
3 4 5 3 dgffg hghg
4 7 . . . hhh
5 6 5 3 dgffg hghg
;
new:
ID TEST VAR ANIMAL TEXT TAPE
1 1 7 3 dgffg hghg
2 7 . . . hhh
3 4 5 3 dgffg hghg
4 7 . . . hhh
5 6 5 3 dgffg hghg
;
Thank you in advance,
Annette
|