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 (January 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 16 Jan 2008 11:54:00 +0100
Reply-To:     Andre Wielki <wielki@INED.FR>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Andre Wielki <wielki@INED.FR>
Subject:      Re: Merge problem
Comments: To: Stefan Pohl <stefan.pohl@ISH.DE>
In-Reply-To:  <ACD013C38FCD462189E7B695CDEC0F44@aktuare.local>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Stefan see this solution among other possible:

data a; input id b1 b2 b3; cards; 1 1 2 1 2 0 2 1 3 1 1 1 4 1 2 0 5 1 3 0 ; run; data b; input a1 a2 a3; cards; 1 2 3 ; run;

data c; set a; if _n_=1 then set b; retain a:;run;

Andre

Stefan Pohl a écrit : > Hi usergroup, > > I want to merge two data sets. > > The first data set contains only one observation, i.e. only one raw: > > a1 a2 a3 > 1 2 3 > > The second data set consists of 5 observations and 3 covariates b1-b3: > > id b1 b2 b3 > 1 1 2 1 > 2 0 2 1 > 3 1 1 1 > 4 1 2 0 > 5 1 3 0 > > The merged data set should be look like this > > id b1 b2 b3 a1 a2 a3 > 1 1 2 1 1 2 3 > 2 0 2 1 1 2 3 > 3 1 1 1 1 2 3 > 4 1 2 0 1 2 3 > 5 1 3 0 1 2 3 > > What is to do? > > Thank you for any help. > > Stefan. > >

-- André WIELKI INED (Institut National d'Etudes Démographiques) Service Informatique 133 Boulevard Davout 75980 Paris Cedex 20 mél : wielki@ined.fr tél : 33 (0) 1 56 06 21 54


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