If you just want to convert the VALUES and not change the variable definitions then use an ARRAY.
data want ;
set have;
array dx dx1-dx25;
do i=1 to dim(dx);
dx(i)=substr(dx(i),1,3);
end;
run;
Note this is good example where the DO OVER syntax is useful, although for some reason SAS has removed it from the documentation. DO OVER is useful where the index value has no meaning since you do not need to use a variable for the index.
data want ;
set have;
array dx dx1-dx25;
do over dx;
dx=substr(dx,1,3);
end;
run;
Since the documentation is gone note that this type of implicit array reference like this will actually use the index variable associated with the array. The default is to use _I_ as that variable. So DO OVER is basically saying DO _I_=1 to 25.