0
votes

This is the first time I've asked a question here so bear with me :)

I am working in SAS Enterprise Guide. I have two data sets that contain data from several years, including 2020 (ASH_Kit1 and ASH_Kit 2 referenced in the code below). However, after I run the following data step, the resulting data set does not contain any data from 2020 even though those two sources of data for this code contain plenty of data for 2020. Anybody have any ideas as to why the 2020 data is disappearing? Please let me know if I can clarify my question at all. Thanks!

Data ash.home_master_appended_onekit;
Set
    tmp7day.ASH_Kit1
    tmp7day.ASH_Kit2
;
Run;
Quit;
1
What variable indicates the date? What format does it have attached to it in each of the source datasets? - Tom
Show your log please. - Reeza
Please add the results/ outputs/ logs. - Anirban Saha

1 Answers

0
votes

Your code seems to be completely fine. As you can see in the next example, when you are concatenating/appending 2 datasets, all the data is retrieved:

  • Code:
data ash_kit1;
   input id year;
   datalines;
1 2019
2 2019
3 2020
;
run;

data ash_kit2;
   input id year;
   datalines;
4 2019
5 2019
6 2020
;
run;

Data home_master_appended_onekit;
Set
    ash_kit1
    ash_kit2
;
Run;
  • Output home_master_appended_onekit:
id Year
1 2019
2 2019
3 2020
4 2019
5 2019
6 2020

My recommendation would be to check the structure of both datasets. Make sure they have the same columns and the same data types in the same order, so you can concatenate them correctly.

Sources: