Published on :
ETL CREATION_INTERNE

Creation of the PAY table with internal data

This code is also available in: Deutsch Español Français
Awaiting validation
This script executes a DATA step to create the PAY table. It reads raw data spread over multiple lines for each observation (identifier, last name, first name, hourly rate, hours worked, and start date). It also calculates a derived variable 'x' corresponding to the year of the start date.
Data Analysis

Type : CREATION_INTERNE


The data is integrated directly into the script using the DATALINES statement.

1 Code Block
DATA STEP Data
Explanation :
DATA step defining the PAY table. The INPUT statement uses a line break indicator '/' to read variables 'hour1' to 'hour3' and 'startdate' on subsequent lines. The YEAR function extracts the year from the start date.
Copied!
1DATA PAY;
2INPUT id lastname $ firstname $
3 payrate / hour1-hour3/
4 startdate MMDDYY10.;
5x = year(startdate);
6FORMAT startdate MMDDYY10.;
7DATALINES;
8528013351 Jones Emily 15.85
930 40 37
101/13/2012
11205284178 Smith Jeremy 13.45
1244 38 42
131/13/2012
14271044878 Mitchell Tyler 15.65
1539 38 45
161/13/2012
17;
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.