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 (April 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 30 Apr 2008 16:54:56 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Programming Question
Comments: To: Vikram Vaidyanathan <vikram.vaidyanathan@gmail.com>
In-Reply-To:  <bd47cf3b0804300935r5468cbcej13bc2770bcc0058b@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Transpose your AE and Meds data sets so that you have the following structure:

DATASET 2 (AE) SUBJID FORMINDEX VarValue VarName 1001 2345 ABCD AETERM 1001 2345 XYZ AETX 1002 4567 CDEF AETERM 1002 4567 MDS AETX

Do the same for the MEDS data set.

Now your problem is reduced to adding VarName to your matching criteria and all you need to do is use SQl or a data step merge to joing your files together.

Toby Dunn

"Don't bail. The best gold is at the bottom of barrels of crap." Randy Pausch

"Be prepared. Luck is where preparation meets opportunity." Randy Pausch

> Date: Wed, 30 Apr 2008 09:35:56 -0700 > From: vikram.vaidyanathan@GMAIL.COM > Subject: Programming Question > To: SAS-L@LISTSERV.UGA.EDU > > Hey folks, > > Here is what I am trying to do. I have DATASET 1 where I need to populate a > new variable "ECVARVAL" . Dataset 1 contains variables ECDS (which has the > dataset names) and ECVAR(which contains the variable names). > > I need to use this information for each observation and access the > corresponding dataset (for eg. AE and MEDS in the example below) and > populate this variable ECVARVAL. > > The key variables in each dataset are SUBJID and FORMINDEX. > > Let me know if there are some creative ideas to do this. > > *Dataset 1:ECDS contains dataset names and ECVAR contains variable names* > > SUBJID ECDS ECVAR FORMINDEX *ECVARVAL * > 1001 AE AETERM 2345 *ABCD* > 1002 AE AETX 4567 *MDS* > 1001 MEDS CMONG 1234 *WERT* > > >> *DATASET 2 (AE)* > > SUBJID FORMINDEX *AETERM * *AETX* > 1001 2345 *ABCD * XYZ > 1002 4567 CDEF *MDS*

> > *DATASET 2 (MEDS)* > > SUBJID FORMINDEX *CMONG* > 1001 1234 *WERT* > > > Thanks, > VV

_________________________________________________________________ In a rush? Get real-time answers with Windows Live Messenger. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_realtime_042008


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