Date: Mon, 2 Feb 2009 11:05:24 +0000
Reply-To: karma <dorjetarap@GOOGLEMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: karma <dorjetarap@GOOGLEMAIL.COM>
Subject: Re: Combining 3 datasets into a file row by row one after the
other
In-Reply-To: <19c76013-ec34-4051-832d-696d78daf43c@n33g2000pri.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
You can use set and by statements to interleve the data.
HTH
data one;
input num @@;
cards;
1 4
;
data two;
input num @@;
cards;
2 5
;
data three;
input num @@;
cards;
3 6
;
data combined;
set one two three;
by num;
run;
proc print;run;
2009/2/2 chumba <vikas.dharamsattu@gmail.com>:
> Hey All,
>
> I need to combine 3 datasets into a file row by row such that first
> observation from the first dataset
> precedes the first row of the second dataset which inturn precedes the
> first row of the third dataset and so on.
>
> ie.
>
> table1 NEW
> DATASET
> obs num
> obs1 ------------------------------------> 1
> obs1 (table1)
> obs2
> obs3
> obs4
> obs5
>
> table2
>
> obs1 -------------------------------------> 2
> obs1 (table2)
> obs2
> obs3
> obs4
> obs5
>
> table3
>
> obs1 -----------------------------------------> 3
> obs1 (table3)
> obs2
> obs3
> obs4
> obs5 4
> obs2 (table1)
> 5
> obs2 (table2)
> 6
> obs2 (table3)
>
> .......and so on...........
>
>
> Can anyone please help me out on this.
>
> Thanks,
> Vikas
>
|