O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

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

Example 9.4 Specifying a Numeric or Character Format at Run Time

Goal

Format the value of a variable in each observation with a format based on the value of another variable.

Example Features

Featured StepPROC FORMAT and DATA step
Featured Step Options and StatementsCATX, PUT, and PUTN functions

Input Data Set

Data set GLOBAL_REVENUE contains annual revenue results from several countries. Values from the USA and Canada are dollars. Values from Belgium, France, and Germany are euros. Values from Japan are yen.

                         GLOBAL_REVENUE

             Obs    country    year         revenue 1 USA 2008 3819501.03 2 USA 2009 -19391.88 3 USA 2010 1033.65 4 Canada 2008 471868.81 5 Canada 2009 297654.01 6 Canada 2010 111123.09 7 Belgium 2008 -1201.30 8 Belgium 2009 404019.87 9 Belgium ...

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