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 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 12 May 2008 23:40:18 -0700
Reply-To:   godfrey.guo@GMAIL.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   godfrey.guo@GMAIL.COM
Organization:   http://groups.google.com
Subject:   Re: A VERY URGENT help needed - DATASET MODIFICATION - has been made
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

On May 13, 11:40 am, need_sas_h...@YAHOO.COM (Tom Smith) wrote: > I had posted this problem earlier. But guesss I could not make it clear in > my last post. So I think I cofused those who tried to help me out. So I am > trying to make it clear below and more simple: > > I have a following dataset having variables:SUB, HR as bellow: > > SUB HR > 1003 post > 1003 pre > 1004 post > 1004 post > 1004 Pre > 1005 post > 1005 pre > 1005 failed > 1005 never tried > > Need to create another dataset from it which will be by the variable SUB > as below(means it will have only one observation for each SUB variable's > value and all the values for HR for that perticular value of SUB will be > in the same record one after another. Plz do not use Proc Report. I need a > dataset. > SUB HR > 1003 post / > pre > 1004 post /post / > Pre > 1005 post / pre / > failed / > never tried

Hi Tom you can try like this:

data a; input sub hr$; cards; 1003 post 1003 pre 1004 post 1004 post 1004 Pre 1005 post 1005 pre 1005 failed 1005 never tried ; proc print;run; data b; set a; by sub; retain hour; if first.sub then hour=cats(hr); else hour=cats(hour)||'/'||cats(hr); if last.sub then output; run;

Best regards Yuewei


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