可以用一个序列ARRAY在加VNAME函数完成。
以下是Sample Code:
data want;
set have;
array x(*) A B C D E;
do i=1 to dim(x);
if missing(x(i)) then x(i)=vname(x(i)) ;
end;
run;
The question is not clear itself. It seems that you have data with 5 columns and there are missing values in some of columns. and you want to fill with values : first column with A, second one with B, etc.
If that is case, it is pretty easy: you can use array if you have many columns to fix. In you example,
you can simply use some ifthen statement:
if col_A is '' then col_A = "A" ;
if col_B is '' then col_B = "B" ;
if col_C is '' then col_C = "C" ;
if col_D is '' then col_D = "D" ;
if col_E is '' then col_E = "E" ;