Date: Tue, 12 May 2009 10:05:03 -0700
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: http://groups.google.com
Subject: Re: output question--one long row into many rows
Content-Type: text/plain; charset=ISO-8859-1
On May 12, 10:51 am, sasandst...@LIVE.COM (D T) wrote:
> Can anyone think of an efficient way to code this output?
The easiest might be to do some transposes followed by a merge. The
'tall' layout of data is very useable in Proc REPORT and TABULATE.
----------------------------------
data wide;
array v[100] (1:100);
array w[100] (1001:1100);
output;
run;
proc transpose data=wide out=v_vars(rename=(_name_=v_name
col1=v_value));
var v:;
run;
proc transpose data=wide out=w_vars(rename=(_name_=w_name
col1=w_value));
var w:;
run;
data tall;
* a one-to-one merge -- no BY statement;
merge v_vars w_vars;
attrib _all_ label = '';
run;
----------------------------------
However, the most efficient is probably done by what is called
'tranposition with arrays'. Numerous conference papers and prior
posts discuss this.
--
Richard A. DeVenezia
http://www.devenezia.com