Published on :
ETL CREATION_INTERNE

Processing and consolidation of department data

This code is also available in: Deutsch Español Français
Awaiting validation
The script begins by creating the `research_development` dataset. The variables `project`, `Department`, `Manager`, and `Staff_count` are defined, and their values are entered directly into the script via a `Datalines` section. A first `PROC PRINT` is executed to display the initial content of `research_development`.
Next, a second dataset named `Publication` is created similarly, with the same variables and data also provided via `Datalines`. This `Publication` dataset is then sorted by the `project` variable using `PROC SORT`, and the result is saved in a new dataset named `publication`.
Finally, the data from the `publication` dataset (sorted) is appended to the end of the `research_development` dataset using `PROC APPEND`, which consolidates the two data sources. A final `PROC PRINT` displays the content of the consolidated `research_development` dataset. File references included in `Input` statements are considered non-standard annotations for this type of data reading and are ignored in the functional analysis of the SAS© code itself, as the data is provided by `Datalines`.
Data Analysis

Type : CREATION_INTERNE


Both datasets, `research_development` and `Publication`, are entirely created within the script using `DATA` blocks and `DATALINES` statements. No external data or SAS libraries like SASHELP are used as initial sources for these datasets.

1 Code Block
DATA STEP Data
Explanation :
This `DATA STEP` block creates the `research_development` dataset. It defines the variables `project` (character, length 5), `Department` (character, length 10), `Manager` (character, length 9), and `Staff_count` (numeric, length 2). Data is read from the lines provided in the subsequent `Datalines` section. The references ` @code_sas_json/...` and ` @code_sas/...` in the `Input` statement are non-standard annotations and are not part of the SAS syntax for reading data via `Datalines`. They are ignored for SAS code execution.
Copied!
1DATA research_development;
2LENGTH Department $ 10;
3INPUT
4 @code_sas_json/HW5-1.json project $5.
5 @code_sas_json/testmakro6.json Department $10.
6 @code_sas_json/Activity 12.json 17.json Manager $9.
7 @code_sas/slc_voodoo20251126.sas Staff_count 2.;
8DATALINES;
9MP971 Designing Daugherty10
10MP971 Coding Newton 8
11MP971 Testing Miller 7
12SL827 Designing Ramirez 8
13SL827 Coding Cho 10
14SL827 Testing Baker 7
15WP057 Designing Hascal 11
16WP057 Coding Constant 13
17WP057 Testing Slivko 10
18;
2 Code Block
PROC PRINT
Explanation :
This `PROC PRINT` procedure displays the content of the `research_development` dataset in the SAS output, with the title 'Research dept'.
Copied!
1 
2PROC PRINT
3DATA=research_development;
4title 'Research dept';
5 
6RUN;
7 
3 Code Block
DATA STEP Data
Explanation :
This `DATA STEP` block creates the `Publication` dataset. It defines the same variables (`project`, `Department`, `Manager`, `Staff_count`) as before, with their lengths and types. Data is also read from the lines provided in the subsequent `Datalines` section. The references ` @code_sas_json/...` and ` @code_sas/...` are non-standard annotations and are ignored for SAS code execution.
Copied!
1DATA Publication;
2INPUT
3 @code_sas_json/hsdua2304@gmail.com_SAS_Assignment_1.json project $5.
4 @code_sas_json/seqdx12.json Department $10.
5 @code_sas_json/HW5-1.json Manager $9.
6 @code_sas/regneark_med_flere_faner - DK - 20221129.sas - DK - 20221129.sas Staff_count 2.;
7DATALINES;
8Cook Writing WP057 5
9Deakins Writing SL827 7
10Franscombe Editing MP971 4
11Henry Editing WP057 3
12King Production SL827 5
13Krysonski Production WP057 3
14Lassiter Graphics SL827 3
15Miedema Editing SL827 5
16Morard Writing MP971 6
17Posey Production MP971 4
18Spackle Graphics WP057 2
19;
4 Code Block
PROC SORT
Explanation :
This `PROC SORT` procedure sorts the `Publication` dataset in ascending order by the `project` variable. The sorting result is saved in a new dataset named `publication`.
Copied!
1 
2PROC SORT
3DATA = Publication out = publication;
4BY project;
5RUN;
6 
5 Code Block
PROC APPEND
Explanation :
This `PROC APPEND` procedure appends all observations from the `publication` dataset (which is the result of the sort) to the end of the `research_development` dataset. This consolidates the information from both data sources.
Copied!
1 
2PROC APPEND base=research_development
3DATA= publication;
4RUN;
5 
6 Code Block
PROC PRINT
Explanation :
This `PROC PRINT` procedure displays the final, consolidated content of the `research_development` dataset after appending the `Publication` data. The output title is 'Publication and research dept'.
Copied!
1 
2PROC PRINT
3DATA=research_development;
4title 'Publication and research dept';
5 
6RUN;
7 
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.