Trying to format a column in a Teradata table using the $BIDI format might generate different results. The results depend on whether the formatting is done by SAS using the PUT function or done in Teradata using the SAS_PUT function.
A difference in results occurs if the format width is longer than the value. For example, when you use the $BIDI12. format, the PUT function results in a variable with a length of 12 with the value left-aligned with blanks appended to fill in for the total length of 12. The SAS_PUT function also results in a variable with a length of 12. However, the value is stored differently. The length of the value is subtracted from the original width and that many blanks are appended before the value, and blanks are appended to the end for the total length of 12.
| Value | PUT | SAS_PUT | Blanks preappended | blanks appended |
|---|---|---|---|---|
| 'Henry ' | 'Henry ' | ' Henry ' | 3 (8 - 5 / length of variable - length of value ) | 4 (width of format - width of original variable) |
| 'William ' | 'William ' | ' William ' | 1 (8 - 7) | 4 |
| 'Amy ' | 'Amy ' | ' Amy ' | 5 (8 - 3) | 4 |
There is no workaround for this issue.