Describe what you mean by "no success"?
You do not need, or likely want parentheses around a case statement; any assignment in a SELECT statement should have AS varname so SQL knows what variable to assign the value to.
PROC SQL;
SELECT
CASE
WHEN oldvar=1 THEN oldvar * 123.45
WHEN oldvar=2 THEN oldvar
END as newvar format=12.2
FROM oldtable;
QUIT;
But the value 123.45 is not going to be much of a test for 12.2 format. A format is not necessarily going to pad the displayed length to 12 characters if the value uses fewer character positions.
Note that this shows that the format is applied and the decimal portion of the display only uses 2 decimal positions and rounds the result to fit:
PROC SQL;
SELECT
CASE
WHEN oldvar=1 THEN oldvar * 123456.876543
WHEN oldvar=2 THEN oldvar
END as newvar format=12.2
FROM oldtable;
QUIT;
... View more