@Invictus wrote:
Hey Tom thank you for your propositions. The first proposition does not give me unique values and simply gives me a stacked list of all products my 5 different datasets have in common. Quid?
Yes. Your were not explicit about what you wanted. The interleaving method is the easiest as it does require you to know it advance how many datasets you are starting with.
If the goal is just to get the list of K_YEAR values then it does not matter about the other variables then the MERGE with the IN= dataset options seems to be the simplest. You can just the copy/paste features of your editor to create some "wallpaper" code.
I cannot remember your convoluted dataset or variable names but the pattern of the code would be like this:
data want;
merge
y2018 (in=in2018)
y2019 (in=in2019)
y2020 (in=in2020)
y2021 (in=in2021)
y2022 (in=in2022)
;
by k_year ;
if in2022 or sum(of in2018-in2022) > 2 ;
keep k_year description;
run;
... View more