One approach is to set OPTIONS MISSING=' '; before the data step. That way the conversion of missing values (not empty) will be to a space character. The Catx function will trim leading and trailing spaces before concatenation, so there is no period or space in the result for the missing values.
options missing=' ';
data mytable;
set WORK.QUERY_FOR_TRNSTRANSPOSED;
length result $4100;
result = catx(';',Столбец1,Столбец2,Столбец3,Столбец4,Столбец5,Столбец6,Столбец7,Столбец8,Столбец9,Столбец10,Столбец11,Столбец12,Столбец13,Столбец14,Столбец15,
Столбец16,Столбец17,Столбец18,Столбец19,Столбец20,Столбец21,Столбец22,Столбец23,Столбец24,Столбец25,Столбец26,Столбец27,Столбец28,Столбец29,Столбец30,Столбец31,Столбец32,
Столбец33,Столбец34,Столбец35,Столбец36,Столбец37,Столбец38,Столбец39,Столбец40);
format result $char.;
run;
/* reset to the default */
options missing='.';
... View more