The number 8 in the LENGTH statement specifies a numeric constant for storing variable values. In this case it specifies to store PD and LGD in 8 bytes. The BESTw. format, used in the FORMAT statement, attempts to write numbers that balance the conflicting requirements of readability, precision, and brevity. See documentation for details: best.-format documentation: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p1fum54c93f8r0n1wrs5mrb05nzi.htm length statement documentation: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p1hgqgmxm3dpqcn1d4w5za5qbz0d.htm Best regards, Jos
edit: including more from @Tom here.
A FORMAT converts values into text. The BEST12. format specification says to display a numeric value using 12 characters. The BEST format will attempt to determine the "best" way to display that particular value in 12 characters. So a larger value might use scientific notation. An integer value would omit the decimal point. etc.
The LENGTH statement determine the storage length used when writing the observations into the SAS dataset. It does not determine how the values will be displayed. There is no need to include a period in the lengths since they can only be integers.
Since SAS uses 64-bit floating point numbers you should generally always use 8 as the length for numbers. The $ indicates that the variable is character. Since SAS stores character strings as fixed length the storage length is the number of bytes that the variable can contain. If you are using a single byte encoding, like WLATIN1, then the number of bytes of storage matches the number of characters that can be stored. But if you are using an encoding like UTF-8 where some characters require more than one byte the number of characters that will fit in the storage length depends on the which characters they are.
... View more