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!
data research_development;
length Department $ 10;
Input
@code_sas_json/HW5-1.json project $5.
@code_sas_json/testmakro6.json Department $10.
@code_sas_json/Activity 12.json 17.json Manager $9.
@code_sas/slc_voodoo20251126.sas Staff_count 2.;
Datalines;
MP971 Designing Daugherty10
MP971 Coding Newton 8
MP971 Testing Miller 7
SL827 Designing Ramirez 8
SL827 Coding Cho 10
SL827 Testing Baker 7
WP057 Designing Hascal 11
WP057 Coding Constant 13
WP057 Testing Slivko 10
;
Explanation : This `PROC PRINT` procedure displays the content of the `research_development` dataset in the SAS output, with the title 'Research dept'.
Copied!
Proc print data=research_development;
title 'Research dept';
RUN;
1
2
PROC PRINT
3
DATA=research_development;
4
title 'Research dept';
5
6
RUN;
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!
data Publication;
Input
@code_sas_json/hsdua2304@gmail.com_SAS_Assignment_1.json project $5.
@code_sas_json/seqdx12.json Department $10.
@code_sas_json/HW5-1.json Manager $9.
@code_sas/regneark_med_flere_faner - DK - 20221129.sas - DK - 20221129.sas Staff_count 2.;
datalines;
Cook Writing WP057 5
Deakins Writing SL827 7
Franscombe Editing MP971 4
Henry Editing WP057 3
King Production SL827 5
Krysonski Production WP057 3
Lassiter Graphics SL827 3
Miedema Editing SL827 5
Morard Writing MP971 6
Posey Production MP971 4
Spackle Graphics WP057 2
;
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!
PRoc Sort data = Publication out = publication;
by project;
run;
1
2
PROC SORT
3
DATA = Publication out = publication;
4
BY project;
5
RUN;
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.
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!
proc print data=research_development;
title 'Publication and research dept';
run;
1
2
PROC PRINT
3
DATA=research_development;
4
title 'Publication and research dept';
5
6
RUN;
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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.