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 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 19 Feb 2009 23:03:02 -0500
Reply-To:     Akshaya Nathilvar <akshaya.nathilvar@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Akshaya Nathilvar <akshaya.nathilvar@GMAIL.COM>
Subject:      Re: need a favor
Comments: To: mike <hadsomeraja@gmail.com>
In-Reply-To:  <4c87e34c-9580-4d01-ac6b-f0fc635f8156@b16g2000yqb.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1

Here's a Hash Solution, but works only for your sample data; might differ for real data Data a; input id label $8.; grp+1; datalines; 01 fasted 02 cool 02 meal ;

Data b; input id label2; if label2=0 then grp+1; cards; 01 0 01 1 01 2 02 0 02 1 02 2 02 0 02 1 02 2 ;

Data c; if 0 then set a; if _n_=1 then do; declare hash aks(dataset:'a',ordered:'a'); aks.definekey('id','grp'); aks.definedata('id','label'); aks.definedone(); end; set b; if aks.find()=0; drop grp; Run;

On Thu, Feb 19, 2009 at 6:46 PM, mike <hadsomeraja@gmail.com> wrote:

> Hi All, > > I have two data sets > > id label > > 01 fasted > 02 fasted > 02 meal > 03 fasted > 03 meal > > > id label > 01 0 > 01 1 > 01 2 > 02 0 > 02 1 > 02 2 > 02 0 > 02 1 > 02 2 > > I need a dataset like this > 01 fasted 0 > 01 fasted 1 > 01 fasted 2 > 02 fasted 0 > 02 fasted 1 > 02 fasted 2 > 02 meal 0 > 02 meal 1 > 02 meal 2 > > can someone help me out please in this issue? >

-- AkshayA!


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