The hard way is an array solution, the easy way would be the transpose
solution. I would vote for transpose.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Thursday, July 22, 2004 10:48 AM
Subject: Transpose or a better way
I am working in a PC XP Environment, using SAS 8.1
I know I can use proc transpose to accomplish the following task, but I
always like to learn some more and find a better/different way of doing
something. Working with SAS-L. is an excellant way to do this, in my
opinion. So the question is: Would you use proc transpose or ??
I have the following data:
id name email zip type city amt
11 john firstname.lastname@example.org y b sf 100
11 john email@example.com y s sr 95
22 mary firstname.lastname@example.org n s xx 110
22 mary email@example.com n s yy 85
22 mary firstname.lastname@example.org n b aa 90
33 joe email@example.com y b cc 120
33 joe firstname.lastname@example.org y s dd 130
I want the output to look like the following:
id name email zip type city amt type city amt
11 john email@example.com y b sf 100 s sr 95
22 mary firstname.lastname@example.org n s xx 110 s yy 85 b
33 joe email@example.com y b cc 120 s dd 130
Thanks for all thoughts, ideas, etc.
Data Mining Analyst
2450 45th St.
Emeryville, CA, 94608
Phone 510 655 0800 ext 4151