From the course: SAS® 9.4 Cert Prep: Part 03 Exploring and Validating Data

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Common formats for numeric values

Common formats for numeric values

- [Instructor] SAS has dozens of formats you can use. Let's look at some of the most common formats and see the effect they have on a numeric value. The w.d format species a width and number of decimal places. The 5. Format is the same as 5.0, so no decimal places are displayed. SAS rounds the displayed value to the nearest integer. By applying the 8.1 format, the value is displayed, rounded to one decimal place. It's okay that the format width is eight even though the digital and decimal point fill only seven positions. The comma format inserts a comma. Specifying a width of 8.1 rounds the value to the nearest tenth. The dollar format inserts a dollar sign in the displayed value. Keep in mind that the width must accommodate the total width of the displayed value including the dollar sign, commas, decimal point, and decimal places. With the format DOLLAR10.2, the entire value is displayed. With DOLLAR10., the…

Contents