Published on :
ETL CREATION_INTERNE

Dataset Creation with Datalines and Display

This code is also available in: Deutsch Español Français
Awaiting validation
The script starts with a DATA step named 'prob12_2'. It reads raw data included via the DATALINES statement with the DSD option to handle delimiters. Specific informats are applied to correctly read dates (DOB and VD). Then, the PRINT procedure is used to list the content of the created dataset, with a specified title.
Data Analysis

Type : CREATION_INTERNE


Data is defined directly in the script using the DATALINES statement.

1 Code Block
DATA STEP Data
Explanation :
Creation of the 'prob12_2' table. Reading instream data with handling of date formats (mmddyy10. and date9.) and character variables.
Copied!
1DATA prob12_2;
2 INFILE DATALINES dsd;
3 informat DOB mmddyy10. VD date9. GENDER $1. NAME $11.;
4 INPUT DOB VD GENDER NAME;
5 FORMAT DOB VD mmddyy10.;
6 
7DATALINES;
810/21/1950,03MAY2004,M,Schneider
911/12/1944,05DEC2004,F,Strawderman
1001/01/1960,25APR2004,M,Smith
11;
2 Code Block
PROC PRINT
Explanation :
Display of the previously created 'prob12_2' table.
Copied!
1PROC PRINT;
2 title 'Problem 12.2';
3RUN;
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.