Thank you very much for solution .
I am trying to get result for macro variable as per below to pass the same values in LENGTH statement .
%put &=var_all; VAR_ALL= Name$8. Sex$1. Age 8. Height 8. Weight 8.
i have tried below code , however for NUM variable how i can get space like " NUM 8. "
proc sql noprint;
create table tt as
select NAME,length,
case when upcase(type) ='CHAR' then '$'
else '.'
end as var_type
into: varlist separated by ' ' ,
: var_len separated by ',',
: var_type separated by ' ' from dictionary.COLUMNS
where upcase(libname) = 'SASHELP' and upcase(MEMNAME) = upcase("CLASS") ;
select case when var_type='$' then cats('',name,var_type,length,'.')
when var_type='.' then cats(' ',name,length,var_type)
else ' '
end as var_all
into:var_all separated by ' '
from tt ;
quit;
%put &=var_all;
In log shows
%put &=var_all; VAR_ALL=Name$8. Sex$1. Age8. Height8. Weight8.
But i want numeric variable length as "Age 8. Height 8. Weight 8. "
... View more