A common trick it to introduce a new new group in the data that has all of the values. This is also frequently done to insure that the names are created in the order wanted. You can even do this using a data step view so that you don't need to make a second copy of your original data. You can then remove the extra group from the output dataset. You should also use the PREFIX= option to tell PROC TRANSPOSE how to name the new variables since names like 1,2,3 etc are not really valid or useful.
data test_fixed / view=test_fixed;
if 0 then set test;
if _n_=1 then do month=1 to 49; output; end;
set test;
run;
proc transpose data=test_fixed prefix=MONTH
out=test_t(where=(not missing(id)))
;
by ID;
id month;
var sale;
run;