On Tue, 30 Aug 2005 01:07:52 -0700, Akramx <akram.chriai@GMAIL.COM> wrote:
> 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.
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" ;
options validvarname = any ;
proc sql noprint ;
select distinct trim(name) || "='" || trim(label) || "'n"
into : renames separated by " "
where libname = "WORK" and
memname = "WITHLABEL" ;
%put <<&renames>> ;
data toexport ;
set withlabel (rename = (&renames)) ;