Published on :
ETL CREATION_INTERNE

Creating and Displaying an In-Stream Dataset

This code is also available in: Deutsch Español Français
Awaiting validation
The first step uses a DATA STEP with the `cards;` statement to read raw data directly embedded in the script and organize it into a temporary SAS© dataset. The second step uses PROC PRINT to display all observations and variables of the newly created dataset in the SAS© output.
Data Analysis

Type : CREATION_INTERNE


Data is directly embedded in the SAS script via the `cards;` statement within a DATA STEP, making it internal and self-contained.

1 Code Block
DATA STEP Data
Explanation :
This DATA STEP block is used to create a temporary SAS dataset named `instream_mtcars`. Variables `cars`, `mpg`, `cyl`, `disp`, `hp`, and `drat` are defined, and data is read directly from the lines following the `cards;` statement. `informat cars$12.;` specifies that the `cars` variable is a character of length 12.
Copied!
1DATA instream_mtcars;
2informat cars$12.;
3INPUT cars$ mpg cyl disp hp drat;
4CARDS;
5Mercedes_AMG 21 6 160 110 3.9
6BMW_X1_AUTO 22.8 4 108 93 3.85
7;
8RUN;
2 Code Block
PROC PRINT
Explanation :
This block uses PROC PRINT to display the entire content of the previously created `instream_mtcars` dataset. It is a simple procedure to visualize the data in the output window.
Copied!
1PROC PRINT DATA=instream_mtcars;
2RUN;
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.