Date: Mon, 9 Apr 2001 01:29:26 +0100
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roland <roland.rashleigh-berry@VIRGIN.NET>
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;
> data b;
> input b;
> data c;
> merge a b;
> retain b;
> 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.