LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1999, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 14 Nov 1999 01:50:43 GMT
Reply-To:     liyuanma@MY-DEJA.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         liyuanma@MY-DEJA.COM
Organization: Deja.com - Before you buy.
Subject:      Re: 'Merging' (?) 2 datasets with one by variable...

Use Cartesian Join Feature in SQL will solve this trivia for you!

************ code ************

options ls=80 ps=60;

data one; input pat var1 $; cards; 99 a 99 b ;

data two; input pat var2 $; cards; 99 y 99 z ;

proc sql; create table three as select one.pat, var1, var2 from one, two where one.pat = two.pat ;

proc print data=three; run;

************ output ************

The SAS System 1 20:42 Saturday, November 13, 1999

OBS PAT VAR1 VAR2

1 99 a y 2 99 a z 3 99 b y 4 99 b z

In article <80ks7q$893$1@nnrp1.deja.com>, machellew@my-deja.com wrote: > I'm absolutely loathe to post this because I am so sure that the > solution is trivial, but once again, I'm stuck... (It's been a bad > week). > > Here's the simplified form of my problem: I have 2 datasets which look > as follows: > > data one: Pat var1 > 99 a > 99 b > > data two: Pat var2 > 99 y > 99 z > > what I *want* is an output file that give me: > > Pat Var1 Var2 > 99 a y > 99 a z > 99 b y > 99 b z >

Sent via Deja.com http://www.deja.com/ Before you buy.


Back to: Top of message | Previous page | Main SAS-L page