LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 25 Oct 2002 12:15:38 -0400
Reply-To:     Huck <huck@FINN.NOSPAM.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Huck <huck@FINN.NOSPAM.COM>
Organization: Posted via Supernews,
Subject:      Re: How to write multiple dest. records from a single source?
Content-Type: text/plain; charset=us-ascii

On 25 Oct 2002 06:50:23 -0700, (Will Dwinnell) wrote:

>I was hoping someone could at least get me started with solving this >problem: > >The source data set has 300 columns, which represent 3 measurements on >100 distinct items. The destination data set should have 3 columns >(one for each measurement) and 100 times the number of records as the >source. So, the first record in the destination data set will have 3 >fields: fields number 1, 101 and 201 from the first record of the >source data set. The second record of the destination data set will >have fields 2, 102 and 202 from the first record of the source data >set, and so on. >

if the vars are x1-x100 x101-x200 and x201-x300 im in favor of the following technique

data out(drop=x1-x300 _i_ ); set in; array xs(100) x1-x100; array ys(100) x101-x200; array zs(100) x201-x300;

do _i_=1 to 100; newx=xs(_i)); newy=ys(_i)); newz=zs(_i)); OUTPUT; end; run;

>I have looked through the SAS help a little, and thought that I might >be able to use ARRAYs with TRANSPOSE, but I'm not sure how to output >multiple records from a single source record. Any suggestions?

the key is the word in CAPS above... OUTPUT, which puts out a record under programers control.

> >Thanks!

Back to: Top of message | Previous page | Main SAS-L page