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 (August 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 17 Aug 2009 11:32:10 -0400
Reply-To:     Nathaniel Wooding <nathaniel.wooding@DOM.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nathaniel Wooding <nathaniel.wooding@DOM.COM>
Subject:      Re: SAS coding
In-Reply-To:  <a00aca8f-bdcb-4387-9718-8374f7b77312@r34g2000vba.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"

You could do this with a data step but proc transpose is much simpler to code:

dATA A; informat Country $3. Var $7.; INPUT Country Var Value Year; cards; USA Exports 1200 1990 USA Imports 1300 1990 run; proc transpose data = a out = a ( drop = _name_ ); var value; id var; by country year; run; proc print; run;

Nat Wooding

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nickname unavailable Sent: Monday, August 17, 2009 10:45 AM To: SAS-L@LISTSERV.UGA.EDU Subject: SAS coding

How does one convert the following data format

Country Var Value Year USA Exports 1200 1990 USA Imports 1300 1990

into the following

Country Imports Exports Year USA 1200 1300 1990

Would appreciate any help. Thanks. 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