f



Re: A question on SAS help example

Thanks. Yes, according to the description of "outer union corr", it
only overlays the columns with the same name. Date1 and Date2 are
columns with different names, so they should not be overlaid.


On 9/12/05, Howard Schreier <hs AT dc-sug DOT org> <nospam@howles.com> wrote:
> The result you got is what one would predict.
>
> The table presented by SAS is what results from coding
>
>   union all
>
> in place of
>
>   outer union corr
>
> Looks to me like an editing goof.
>
> On Mon, 12 Sep 2005 14:10:16 -0400, Junwu Shen <jxs705@GMAIL.COM> wrote:
>
> >Hi,
> >
> >This is an example in SAS help to show how to concatenate datasets
> >using SQL. But the result given below does not make sure to me. I ran
> >the program, and got the following result: Can anybody explain what
> >was wrong? Thanks.
> >                                       Obs    data1    data2
> >
> >                                         1      1996        .
> >                                         2      1997        .
> >                                         3      1998        .
> >                                         4      1999        .
> >                                         5         .     1997
> >                                         6         .     1998
> >                                         7         .     1999
> >                                         8         .     2000
> >                                         9         .     2001
> >
> >
> >
> >Example from SAS help:
> >
> >The following shows the YEAR1 and YEAR2 input tables:
> >
> >YEAR1                 YEAR2
> >
> >Date1                 Date2
> >
> >1996
> >1997                  1997
> >1998                  1998
> >1999                  1999
> >                          2000
> >                          2001
> >
> >The following SQL code creates and prints the table COMBINED.
> >
> >proc sql;
> >   title 'SQL Table COMBINED';
> >   create table combined as
> >      select * from year1
> >      outer union corr
> >      select * from year2;
> >      select * from combined;
> >quit;
> >
> >Concatenated Tables (SQL)
> >
> >                               SQL Table
> COMBINED                              1
> >
> >                                        Year
> >                                    --------
> >                                        1996
> >                                        1997
> >                                        1998
> >                                        1999
> >                                        1997
> >                                        1998
> >                                        1999
> >                                        2000
> >                                        2001
>
0
jxs7051 (11)
9/12/2005 6:41:39 PM
comp.soft-sys.sas 142827 articles. 3 followers. Post Follow

0 Replies
408 Views

Similar Articles

[PageSpeed] 2

Reply: