Charlotte,
The $w formats expect to find character strings as the incoming values. Leave out the dollar sign and the software expects a numeric as the incoming value.
If you specify a width that is wider than the numeric value:
newvar = put(12345678, 10.);
You get a leading blank (or as many leading blanks as needed) to fill out the resulting string. Note that the PUT function always returns a character string regardless of whether the format is numeric or character.
When in doubt, experiment. You can always check your results with something like this:
newvar2 = '*' || newvar || '*';
put newvar2=;
People who are trying to learn are never a bother. Merry Christmas to you as well.
... View more