Published on :
ETL CREATION_INTERNE

Creation of the MYLIB.CLASS1 table

This code is also available in: Deutsch Español Français
Awaiting validation
The script starts by defining a libname 'mylib' pointing to the '/folders/myfolders/' folder. Then, a DATA step is used to create the 'mylib.class1' table. Data is provided directly in the script via the `cards` statement, with variables cars (character), mpg, cyl, disp, hp, and drat (numeric). Two observations are inserted into the table.
Data Analysis

Type : CREATION_INTERNE


Data is provided directly in the SAS script via the `cards` (datalines) statement, meaning it is internally created without external dependency on a pre-existing data source.

1 Code Block
Libname Statement
Explanation :
Defines the SAS library 'mylib' which points to the file path '/folders/myfolders/'. This allows access to files in this directory and storing new tables there via the 'mylib' libref.
Copied!
1LIBNAME mylib "/folders/myfolders/";
2 Code Block
DATA STEP Data
Explanation :
This DATA step creates a new SAS table named 'class1' in the 'mylib' library. The `input` statement defines the variables (cars as a character string '$', and mpg, cyl, disp, hp, drat as numeric) and their order. The `cards` statement indicates that the following data, up to the semicolon and `run;`, is instream data to be read to create the table observations.
Copied!
1DATA mylib.class1;
2INPUT cars$ mpg cyl disp hp drat;
3CARDS; /*cards user to insert instream data*/
4Mercedes_AMG 21 6 160 110 3.9
5BMW_X1_AUTO 22.8 4 108 93 3.85
6;
7RUN;
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.