Victor
Victor

Reputation: 17077

SAS format is loaded but cannot be used

I loaded a format and my log says:

NOTE: Format $DEPOSIT is already on the library WORK.FORMATS.
NOTE: Format $DEPOSIT has been output.

But when I use it:

D_SYS = PUT(SOURCE,$DEPOSIT.);

I get:

ERROR 48-59: The format DEPOSIT was not found or could not be loaded.

Upvotes: 0

Views: 2445

Answers (1)

Tom
Tom

Reputation: 51566

If you try to apply a character format to a numeric value (and the reverse) then SAS will silently convert the format specification to match the data you are applying it to.

So you created the character format $DEPOSIT and are trying to apply it to the numeric variable SOURCE. So the error message is saying that the numeric format DEPOSIT does not exist.

Check that the variable SOURCE actually exists. SAS will create a numeric variable if you reference a variable that does not exist. If your variable really is numeric then you might get it to work if you convert SOURCE to character, but make sure to transform the numbers into character strings that match what the format expects.

D_SYS = PUT(cats(SOURCE),$DEPOSIT.);

Upvotes: 1

Related Questions