Ifound nice solution, maybe people can show other ways?
data labels_info_tbl;
infile datalines dlm="," dsd;
length label $100 Var_name $10;
input Var_name $ label;
cards;
custID,Customer Id number
Wealth,wealth in bank in USD
education,level of education
;
run;
data have;
/*label*/
/*custID= 'Customer Id number'*/
/*Wealth= 'wealth in bank in USD'*/
/*education= 'level of education'*/
/*;*/
input custID Wealth education;
cards;
111 30000 15
222 7000 12
333 350000 21
;
Run;
proc sql noprint;
select catx('=',Var_name,quote(trim(label))) into : label_stmt separated by ' '
from labels_info_tbl
;
quit;
%put label_stmt=&label_stmt;
/*label_stmt=custID="Customer Id number" Wealth="wealth in bank in USD" education="level of education"*/
proc datasets lib=work nolist;
modify have;
label &label_stmt;
quit;
... View more