O'Reilly logo

SAS Certification Prep Guide, 4th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Custom Formats Using the VALUE Statement

Review of Creating Non-Overlapping Formats

You can use the VALUE statement in the FORMAT procedure to create a custom format for displaying data in a particular way. For example, suppose you have airline data and you want to create several custom formats that you can use for your report-writing tasks. You need formats that enable you to do the following:
  • group airline routes into zones
  • label airport codes as International or Domestic
  • group cargo revenue figures into ranges.
The following PROC FORMAT step creates these three formats:
proc format; value $routes 'Route1' = 'Zone 1' 'Route2' - 'Route4' = 'Zone 2' 'Route5' - 'Route7' = 'Zone 3' ' ' = 'Missing' other = 'Unknown'; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required