|
Brillant idea,
but it may be necessary to improve the code by using the SUM-Function
instead of addition, as I am afraid the standard addition of missing values
may deliver missing value as a result while the SUM function interpretes
missing values as zero.
Mit freundlichen Grüßen
Best regards
Michael Eckhardt
Berater Business Intelligence
T-Systems ITS GmbH
GS FDL Mitte
Frankfurter Str. 27
65760 Eschborn
Tel. (06196) 961-530
Fax (06196) 961-517
Michael.Eckhardt@t-systems.de
-----Ursprüngliche Nachricht-----
Von: Dorfman, Paul [mailto:Paul.Dorfman@BCBSFL.COM]
Gesendet: Mittwoch, 5. Dezember 2001 22:57
An: SAS-L@LISTSERV.UGA.EDU
Betreff: Re: merge with 4 datasets and create a count variable
Max,
Try this concept:
data ... ;
merge ds1(in=ds1) ds2(in=ds2) ds3(in=ds3) ds4(in=ds4) ;
by key ;
count = ds1 + ds2 + ds3 + ds4 ;
run ;
Kind regards,
==================
Paul M. Dorfman
Jacksonville, FL
==================
> -----Original Message-----
> From: Max F [mailto:max8ca@YAHOO.COM]
> Sent: Wednesday, December 05, 2001 4:34 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: merge with 4 datasets and create a count variable
>
>
> Hello,
>
> Someone please help.
>
> I have a list of ids. I want to check this list agaist
> four datasets.
> If a given id exists in all four datasets, the new
> variable COUNT is '4',
> and so on. If a given id does not exist in any
> dataset, COUNT is '0'.
> I know how to do this using a number of data steps,
> but I think there must
> be a more efficient way to do this. Your help is
> highly appreciated.
>
> Max
>
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>
>
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.
|