From the course: SAS® 9.4 Cert Prep: Part 11 Creating and Using Custom Formats

Unlock this course with a free trial

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

Demo: Creating custom formats from tables

Demo: Creating custom formats from tables

- [Professor] In this example, we'll build a custom format from a lookup table. Let's start with the first two steps in this program. The first data step is creating a temporary table called sbdata. So we're using the storm_subbasincodes lookup table, but remember, in order to be able to use this data to create a custom format, it needs to have the three required columns. First, the column 'fmtName' which rebuilding with the retain statement and just assigning a constant value of $sbfmt. The other columns that are required are 'start' and 'label'. However, we need to rename the existing columns in subbasincodes. So, sub_basin, that has the raw coded values, will be 'start' and subBasin name, which is the descriptive name, will be 'label'. And I only need to keep those three required columns. So I'll start by running the data step. And we can see our tables prepared and ready to go to read in with the proc format step.…

Contents