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 (May 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 12 May 2009 12:17:01 -0400
Reply-To:   Nathaniel.Wooding@DOM.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:   Re: output question--one long row into many rows
In-Reply-To:   <BLU132-W103C3BCD1DFAB7E2C3B120C8600@phx.gbl>
Content-Type:   text/plain; charset="UTF-8"

Does this work for you?

Data have; input ID numa pcta numlt pctlt numo pcto numf pctf ; cards; 1 52 2.6 13 0.6 6 0.3 220 10.9 2 13 0.6 101 5.0 11 2.1 13 0.7 211 905 4.0 732 3.6 87 3.3 1176 9.8 Data Wanted ( drop = id); set have (where = ( id = 211)); proc print;run;

Data _null_ ; set wanted; file print; array able _numeric_;

do i = 1 to dim(able) by 2; put able{i} able{i+1}; end; run;

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977

D T <sasandstats@LIVE .COM> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject output question--one long row into many rows 05/12/2009 10:51 AM

Please respond to D T <sasandstats@LIVE .COM>

I have a data set like this (I am just showing some variables, there are more):

ID numa pcta numlt pctlt numo pcto numf pctf

1 52 2.6 13 0.6 6 0.3 220 10.9

2 13 0.6 101 5.0 11 2.1 13 0.7

[…]

211 905 4.0 732 3.6 87 3.3 1176 9.8

I need to output data for ID 211 only—this is a summary row. I can use a proc print and get the information I need printed (one long row of output), but am wondering if there isn’t way I can make the output more user-friendly.

Here is what I would like to have in a table, if possible:

numa pcta

numlt pctlt

numo pcto

numf pctf

…. etc.

In terms of output, it would look like this for my example:

905 4.0

732 3.6

87 3.3

1176 9.8

Can anyone think of an efficient way to code this output?

Thanks!

D.T.

_________________________________________________________________ Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009 CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.


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