Published on :
Data Preparation CREATION_INTERNE

Creation of Salary Data Table

This code is also available in: Deutsch Español Français
Awaiting validation
The program uses a DATA STEP to build a data table called 'salary'. The defined variables are 'Brand' (character), 'Qty' (numeric), and 'Amount' (numeric, formatted as currency). Data is directly provided via the DATALINES statement, including entries for 'Pampers', 'Huggies', 'Seventh Generation', and 'Nature Babycare'.
Data Analysis

Type : CREATION_INTERNE


The data is directly embedded in the script via the DATALINES statement. It does not come from SASHELP nor from an external source.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block is responsible for creating and populating the 'salary' data table. It defines three variables: 'Brand' as an 18-position character string, 'Qty' as an integer, and 'Amount' as a decimal number formatted as currency. The INPUT statement reads data line by line, and the DATALINES statement provides the raw values to be integrated into the table. The ':DOLLAR6.2' format is applied to the 'Amount' variable when reading the data.
Copied!
1* Create a data set with variables named Brand, Qty, and Amount ;
2DATA salary;
3 INPUT Brand $ 1-18 Qty Amount :DOLLAR6.2;
4 DATALINES;
5Pampers 42 $44.99
6Huggies 7 $34.99
7Seventh Generation 7 $39.99
8Nature Babycare 4 $41.99
9;
10RUN;
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.