In reply to Victor Estevao.

In the SAS/IML language, "||" means "horizontal concatenation of matrices." What you want is string concatenation, which is the "+" operator:
call symput('matfrmt', strip(char(w)) + "." + strip(char(d)) );
%put "matfrmt=&matfrmt";

However, you don't need to do any of this, since the CHAR function accepts w and d as parameters. Just use the following:
x = 1.23456789;
s = char(x, w, d); /* applies w.d format to x */