I am new to SAS and didn't find an answer to my question. Maybe this community would/could be so Kind to help me.
Is it possible to define the value of a macro variable as the length of another variable? I do know that the value of a macro is character, but is there a way to do is?
My Problem is this: I want to check my variable for the longest value and set the length of the longest value as a new length for the variable. Therefore I used this program:
proc sql;
select max(length(variable))
into: length_variable
from dm_comp;
quit;
%put length_variable;
Now I have the value as character in my macro, but I don't know how to use this macro to set a new length. Is it even possible to do this way? If not, do you have an idea how to do it better? Thank you very much for your help.