I have a SAS file A which has no labels. I have another file B in which i have only 2 columns which has values (Column1: All column names in Table 1 and Column2 has all the labels) How to pull the labels which are present as a values from File B and make it as a label in File A.
data main; a=1234; b=23; run; data labels; var="a"; lab="A label for a"; output; var="b"; lab="A label for b"; output; run; data _null_; set labels end=last; if _n_=1 then call execute('proc datasets nolist lib=work; modify main; label '); call execute(cat(var,'="',strip(lab),'" ')); if last then call execute(';quit;'); run;
|Name||Name of the employee|
|Age||age of the employee|
|Sex||sex of the employee|
|Salary||salary of the employee|
Does it work in the above scenario? i wanna create a Dataset3 which is a copy of dataset 1 with all the labels
Very similar tools ... the idea is to generate the proper DATA step:
call execute('data test_ae; set ae; label ');
do until (done);
set ae_info end=done;
call execute(col || '= "' || label || '"');
call execute('; run;');
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.