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 (March 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 25 Mar 2008 12:23:37 -0700
Reply-To:     Haris <Karovaldas@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Haris <Karovaldas@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: how to add the observations in dataset2 to the variables in
              dataset1?
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

Sounds like all you want to do is rename the variables in your dataset2. You should read the variable names in dataset1 into a macro and then do the renaming in the DATA step. I prefer PROC SQL. Here's an approximate untested syntax that should give you the results you want.

proc sql ; select Name into :Macro1 separated by " " from dictionary.columns where libname="LIBRARY" memname="DATASET1" ;

select Name into :Macro2 separated by " " from dictionary.columns where libname="LIBRARY" memname="DATASET2" ; quit ;

data dataset2 ; set dataset2 (rename &Macro2 = &Macro1) ; run ;


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