Published on :
Data Manipulation CREATION_INTERNE

Monetary Data Formatting

This code is also available in: Deutsch Español Français
Awaiting validation
The script initializes a SAS© table named 'Format_Money' with raw numeric values entered manually. It then applies the SAS© format 'DOLLAR7.2' to the 'COST' variable for standard monetary display.
Data Analysis

Type : CREATION_INTERNE


Data is directly defined in the code via the CARDS (datalines) statement.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'Format_Money' table by reading data included in the stream (CARDS). The 'COST' variable is created.
Copied!
1DATA Format_Money;
2 INFILE CARDS;
3 INPUT COST;
4 CARDS;
5123.45
6678.90
7;
8RUN;
2 Code Block
DATA STEP
Explanation :
Modification of the 'Format_Money' table to associate the 'DOLLAR7.2' display format with the 'COST' variable.
Copied!
1DATA Format_Money;
2 SET Format_Money;
3 FORMAT COST DOLLAR7.2;
4RUN;
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.