LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 4 Feb 2003 13:39:42 -0800
Reply-To:   Mark Terjeson <mark.terjeson@NWCSR.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Mark Terjeson <mark.terjeson@NWCSR.COM>
Subject:   Re: Problem
Comments:   To: Jishnu <jishguha@YAHOO.COM>
In-Reply-To:   <>
Content-Type:   text/plain; charset="us-ascii"


Here is one possibility.

I threw in an extra in one year just in case that needed to be covered.

data Table1; input uid $ year; cards; x 1999 x 2000 x 2000 y 2001 x 2001 y 2002 x 2002 ; run;

proc sql; create table Table2 as select uid, count(uid) as count, year from Table1 group by year,uid order by uid,year ; quit;

proc transpose data=Table2 out=Table3(drop=_name_); by uid; id year; var count; run;

Hope this is helpful, Mark Terjeson Northwest Crime and Social Research, Inc. A SAS Alliance Partner 215 Legion Way SW Olympia, WA 98501 360.870.2581 - voice,cell 360.570.7533 - fax

"Nothing is particularly hard if you divide it into small jobs." - Henry Ford, Industrialist

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jishnu Sent: Tuesday, February 04, 2003 12:52 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Problem

Hi does any body how to solve this isssue:

Original Dataset

uid year x 1999 x 2000 y 2001 x 2001 y 2002 x 2002

I would like to transform it into

99 00 01 02 1 1 1 1 1 1

Since x originated on 1999 that is why 99 gets 1 and stays on till the year is available Since y is originated in 2001 it gets a 1 at 2001.

Thank you

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