Date: Tue, 28 Apr 2009 16:08:56 -0400
Reply-To: Ya Huang <ya.huang@AMYLIN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ya Huang <ya.huang@AMYLIN.COM>
Subject: Re: SQL:Left join
Looks like your missing options has been set to '0'. I tried
with missing as you expected.
Try add this line before your code:
options missing=.;
On Tue, 28 Apr 2009 15:53:58 -0400, Yu Zhang <zhangyu05@GMAIL.COM> wrote:
>Hi,
>
>I am really confusing now when I was using left join to combine two
>datasets. with my past experience, the variable from Right had side table
>will be missing for any non-matching row. But it was assigned with value
of 0.
>
>I am using SAS9.1 on Win. the sample code is here:
>
>data a;
>do a=1 to 5;
>output;
>end;
>run;
>
>data b;
>do a=1,4;
>b=100;
>output;
>end;
>run;
>
>proc sql;
>select * from a natural left join b
>;
> quit;
>
>the output I expected is:
>
>1 100
>2 .
>3 .
>4 100
>5 .
>
>Can anyone explain why 0 was assigned to the non-matching rows?
>
>TIA.
>
>Yu
|