Date: Mon, 9 Apr 2001 01:29:26 +0100
Reply-To: roland.rashleigh-berry@virgin.net
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roland <roland.rashleigh-berry@VIRGIN.NET>
Organization: N/A
Subject: Re: retain statement
Content-Type: text/plain; charset=us-ascii
Annie Chang wrote:
>
> A very simple thing, almost feel embarassed to ask:
>
> data a;
> input a;
> cards;
> 1
> 2
> ;
>
> data b;
> input b;
> cards;
> 3
> ;
>
> data c;
> merge a b;
> retain b;
> run;
>
> I wish by using the 'retain' statement I can use the
> single oberservation from dataset b for all the
> observations. i.e. the dataset would look like
> 1 3
> 2 3
>
> However, the retain statement didn't do what I
> thought it would. In other words, the final dataset c
> look like
>
> 1 3
> 2 .
>
> What is the better way to achieve my goal?
>
> Thank you!
Use proc sql to do a cartesian join.
|