Date: Fri, 10 Sep 2010 15:52:12 -0500
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: Please ignore my prevoius post ( made a mistake there). I
Need To Exclude Rcords Wth All missing values Please help me.
In-Reply-To: <AANLkTinqsiJ_KwR++GAnMm9pCLd4doBniUUBjF1k1yqs@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Actually, apparently need my google goggles again :) LENGTHM is not needed
- just take the ADDR difference in the first two variables.
addr(chars[2]) - addr(chars[1]);
Note: this only works if the data set is actually just as you describe it -
ie, no intervening variables.
-Joe
On Fri, Sep 10, 2010 at 3:51 PM, Joe Matise <snoopy369@gmail.com> wrote:
> Ah, version 8.1 - at my shop we call that the missing version, as we went
> from 8 to 8.2 :)
>
> Anyway, I could imagine a PEEK solution here. This is probably more
> complex than needed but I like practicing :)
>
>
> data test;
> infile datalines truncover;
> input
> @1 id
> @9 a $8.
> @18 b $8.
> @27 c $8.
> @36 d $8.;
> datalines;
>
> 101 earth moon sun jupitar
> 101
> 101 moon jupitar
> 103
> 102 Planet fitness
> 102
> 103 LA PA JA SA
> 103 oper bus car
> ;;;;
> run;
>
> *commented out stuff is there if you want to see what is going on under the
> hood;
> data want;
> set test;
> array chars _character_;
> *y = lengthm(chars[1])*dim(chars);
> *charpeek = peekc(addr(chars[1]),lengthm(chars[1])*dim(chars));
> if peekc(addr(chars[1]),lengthm(chars[1])*dim(chars)) = repeat('
> ',(dim(chars)*lengthm(chars[1]))-1) then delete;
> /*array xs x1-x4;
> do __t = 1 to 4;
> xs[__t]=addr(chars[__t]);
> end;*/
> run;
>
> I don't know if LENGTHM is in 8.1 - if not you may need to hardcode the
> lengths (max length of any of the character variables in memory storage, not
> in character count).
>
> -Joe
>
>
> On Fri, Sep 10, 2010 at 3:29 PM, Tom Smith <need_sas_help@yahoo.com>wrote:
>
>> I have a following dataset with four character variables: subjet, as, de,
>> sw, er. I need
>> to excluse those observations in result dataset where all variable has
>> missing values.
>> I tried with CMISS function. but it did not work since I guess my sas is
>> 8.1, can not use a lot of
>> fuction. May be we need to use a datastep.
>>
>> subjet as de sw er
>> ------ --- -- -- --
>> 101 earth moon sun jupitar
>> 101
>> 101 moon jupitar
>> 103
>> 102 Planet fitness
>> 102
>> 103 LA PA JA SA
>> 103 oper bus car
>>
>> The result should be as below:
>>
>> subjet as de sw er
>> ------ --- -- -- --
>> 101 earth moon sun jupitar
>> 101 moon jupitar
>> 102 Planet fitness
>> 103 LA PA JA SA
>> 103 oper bus car
>>
>
>
|