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.

Demo: Formatting data values in results

Demo: Formatting data values in results

- [Instructor] In this demo we'll use the format statement to enhance the values that appear in a proc print report. So we'll start just with the basic proc print report. And the data that we'll analyze, will be the PG1.Storm_damage table. I'll run this step to start with just to see what the default report looks like. So notice date is in its raw numeric form. The number of days from January 1st 1960, which makes it pretty impossible to interpret and looking at the report. Cost is also a raw numeric value. Commas and dollar signs would help to make those values more meaningful, and deaths, for Hurricane Katrina, a comma would be appropriate in the thousands position. So let's go back to the code and add a format statement. I'll start with the key word, format, and first we'll format the column date. The format I'll apply will be the mmddyy format, and if I provide a width of 10, then that will allow enough display…

Contents