Hi everyone, I want to adjust a macro - here called MacroBL -, which was developed by someone else. For this macro to function, I need to write the variables that I want and separate them with an backslash (\). For each variable I need to write the name, type (CTN: continuous, or CTG: categorical) and label manually. There is no way for this macro to retrieve the variable's format. What I have tried to do for the last six hours is to let the macro recognize the variable's label, format and type directly as present in the data. I tried several methods like using vlabelx, varlabel or %sysfunc(varlabel) but I didn't get it to work. I am not a macro expert and the answer should be really easy. Do you guys have an idea? Thanks in forward. Here is the essential part of the macro I'm trying to manipulate. %MacroBL(data=, var=var1|CTN|label1\ var2|CTG|label2) %let nvar=%sysfunc(countw(&var,%str(\)));
%do n=1 %to &nvar;
%let var&n=%scan(%qscan(&var,&n,%str(\)),1,|);
%let vartype&n=%scan(%qscan(&var,&n,%str(\)),2,|);
%let varlabel&n=%scan(%qscan(&var,&n,%str(\)),3,|);
... View more