Date: Tue, 14 Apr 2009 19:03:15 +0800
Reply-To: Alex Murphy <goladin@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Alex Murphy <goladin@GMAIL.COM>
Subject: Re: Data manipulation
In-Reply-To: <F4FBDB210BF84B36BADDBE7D5CF6C7F2@aktuare.local>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
Can I just check whether x2, y2 and id2 has any relations with the original
variables?
On Tue, Apr 14, 2009 at 6:58 PM, POHL, Dr., Stefan - AKTUARE <
pohl@aktuare.de> wrote:
> Hi,
>
> I need a more general solution.
>
> Suppose I have this data:
>
> Id1 x1 y1
> 1 1 4
> 4 4 2
> 8 7 3
>
> And I want to have this data:
>
> Id1 Id2 x1 y1 x2 y2
> 1 1 1 4 1 4
> 1 4 1 4 4 2
> 1 8 1 4 7 3
> 2 1 4 2 1 4
> 2 4 4 2 4 2
> 2 8 4 2 7 3
> 3 1 7 3 1 4
> 3 4 7 3 4 2
> 3 8 7 3 7 3
>
> Thank you for your help, Stefan.
>
>
>
>
> ------------------------------
> *Von:* Alex Murphy [mailto:goladin@gmail.com]
> *Gesendet:* Dienstag, 14. April 2009 12:48
> *An:* POHL, Dr., Stefan - AKTUARE
> *Cc:* SAS-L@listserv.uga.edu
> *Betreff:* Re: Data manipulation
>
> Hi,
>
> Try this.
>
> DATA T;
> SET T;
>
> DO I = 1 TO 3;
>
> ID2 = I;
> X2 = I;
> Y2 = I;
>
> OUTPUT;
>
> END;
>
> RUN;
>
> On Tue, Apr 14, 2009 at 6:10 PM, POHL, Dr., Stefan - AKTUARE <
> pohl@aktuare.de> wrote:
>
>> Hi,
>>
>> I have this data:
>>
>> Id1 x1 y1
>> 1 1 1
>> 2 2 2
>> 3 3 3
>>
>> I want to have this data:
>>
>> Id1 Id2 x1 y1 x2 y2
>> 1 1 1 1 1 1
>> 1 2 1 1 2 2
>> 1 3 1 1 3 3
>> 2 1 2 2 1 1
>> 2 2 2 2 2 2
>> 2 3 2 2 3 3
>> 3 1 3 3 1 1
>> 3 2 3 3 2 2
>> 3 3 3 3 3 3
>>
>> How can I do this?
>>
>> Thank you for help, Stefan.
>>
>
>
>
> --
> Regards,
> Murphy Choy
>
> Certified Advanced Programmer for SAS V9
> Certified Basic Programmer for SAS V9
> DataShaping Certified SAS Professional
>
>
--
Regards,
Murphy Choy
Certified Advanced Programmer for SAS V9
Certified Basic Programmer for SAS V9
DataShaping Certified SAS Professional
|