/***************************************************************************************************************** SAS file name: format_nesting.sas File location: __________________________________________________________________________________________________________________ Purpose: To demonstrate how to nest formats in PROC FORMAT. Author: Peter Clemmensen Creation Date: 20/10/2020 This program supports the blog post "Nesting Formats in SAS With Proc Format" on SASnrd.com *****************************************************************************************************************/ /* Create two formats and next 'inner' within 'outer' */ proc format; value inner 500 -< 600 = 'Over 500' 600 -< 700 = 'Over 600' 700 -< 800 = 'Over 700' 800 -< 900 = 'Over 800' other = 'Over 900'; value outer 1 = 'One' 2 = 'Two' 500 -< 1000 = [inner] other = [8]; run; /* Test it */ data have; input x; put x outer.; datalines; 1 2 3 200 300 400 500 600 700 800 900 1000 ;