Published on :
Utility CREATION_INTERNE

Definition of numeric format fmtNum

This code is also available in: Español Français
This SAS© script defines a permanent value format 'fmtNum' that classifies numbers as 'negative', 'zero', 'positive', and missing values as 'missing'. This format is useful for presenting numerical data in reports or for logically grouping these values.
Data Analysis

Type : CREATION_INTERNE


This script does not consume external or internal SASHELP data. It creates a format definition that can later be applied to numeric variables in existing datasets. The origin of the target data is not relevant for this definition block.

1 Code Block
PROC FORMAT (VALUE definition)
Explanation :
This code block uses the VALUE statement, implicitly contained within a PROC FORMAT, to create the custom format 'fmtNum'. It assigns textual labels based on numeric value ranges:
- 'negative' for any value strictly less than zero.
- 'zero' for the exact value zero.
- 'positive' for any value strictly greater than zero.
- 'missing' for all other values, including SAS missing values (period or underscore).
Copied!
1value fmtNum
2 low -< 0 = "negative"
3 0 = "zero"
4 0 <- high = "positive"
5 other = "missing"
6 ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : `fmtNum` format