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 (August 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 2 Aug 1999 08:36:06 +0100
Reply-To:     tra <tra@PROTEUS.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:     To: Tom Frenkel <taf2@IS8.NYU.EDU>
From:         tra <tra@PROTEUS.CO.UK>
Organization: Proteus Molecular Design Ltd
Subject:      Re: Making label follow value (in merge)
Content-Type: text/plain; charset=us-ascii

Here is a trick I have used in similar circumstances:

data merged ; merge b(obs=0) a b ; by byvar ; run ;


Tom Frenkel wrote:

> To SAS-L: > > It seems that, when you merge 2 datasets that have a common variable, SAS > uses the label assigned to the *first* instance of the variable it sees, > while of course using the value of the *last* instance. Thus if we have: > > data a ; > byvar=1 ; > x=10 ; > label x = 'from a' ; > run ; > > data b ; > byvar=1 ; > x=20 ; > label x = 'from b' ; > run ; > > data merged ; > merge a b ; > by byvar ; > run ; > > the value of x in "merged" will of course be 20. But its label will be > 'from a'. Is there any way to change the label to 'from b', thus making > the label of the variable consistent with its value? Thanks! > > --Tom > > Tom Frenkel > Assoc. Research Scientist > Center for Health & Public Service Research > New York University >

-- T R Auton PhD MSc C.Math Head of Biomedical Statistics Proteus Molecular Design Ltd Beechfield House Lyme Green Business Park Macclesfield Cheshire SK11 0JL UK email:

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