| Date: | Fri, 4 Dec 2009 06:45:22 -0500 |
| 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 Transpose |
|
| In-Reply-To: | <3f07c4ab-53fd-4247-9818-588654206543@b15g2000yqd.googlegroups.com> |
| Content-Type: | text/plain; charset="us-ascii" |
Vanidhar
Try the following:
Data Start;
informat acct $3. Date date. var $2. ;
input ACct date VAr;
Cdate = put( date , date11. );
drop date;
* this assumes that your data set has the dates in SAS date format;
cards;
123 29-JUL-2009 a1
123 29-AUG-2009 a2
123 29-SEP-2009 a3
run;
Proc transpose data = start out = finish ( drop = _name_ ) Prefix = Var_;
var Var;
id cdate;
by acct;
run;
Nat Wooding
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of vanidhar
Sent: Friday, December 04, 2009 5:57 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: SAS Transpose
MY data set is:
ACct# date VAr
123 29-JUL-2009 a1
123 29-AUG-2009 a2
123 29-SEP-2009 a3
what i need is :
ACct# VAr_29-JUL-2009 VAr_29-AUG-2009 VAr_29-SEP-2009
123 a1 a2
a3
CAn anyone help ?
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.
|