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 (August 2005, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 30 Aug 2005 08:55:39 -0400
Reply-To:   Venky Chakravarthy <swovcc@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Venky Chakravarthy <swovcc@HOTMAIL.COM>
Subject:   Re: exporting labels instead of var names
Comments:   To: akram.chriai@GMAIL.COM

On Tue, 30 Aug 2005 01:07:52 -0700, Akramx <akram.chriai@GMAIL.COM> wrote:

>Hello, > I used the export wizard to export my dataset to ACCESS. I was >wondering if it is possible to export the variable labels instead of >the variable names. >Thanks.

Neither could I locate an option in the wizard, nor could I find anything in the proc export documentation to do this. This probably means the use of a kludge. See below for an example. I haven't tested extensively so use with caution. The key is to use the VALIDVARNAME option and then use meta data to rename the variable names to labels before exporting.

data withlabel ; retain x 9 y "Why"; label x = "This is my label" y = "Why" ; run ;

options validvarname = any ;

proc sql noprint ; select distinct trim(name) || "='" || trim(label) || "'n" into : renames separated by " " from dictionary.columns where libname = "WORK" and memname = "WITHLABEL" ; quit ;

%put <<&renames>> ;

data toexport ; set withlabel (rename = (&renames)) ; run ;

Venky Chakravarthy


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