You are attempting to mix SAS MACRO language, macro variable usage, and SAS DATA step processing, which normally is not going to work properly. Read up on CALL EXECUTE and you'll see that the invoked code will actually execute *AFTER* the current DATA step completes.
Suggest adding the code below to get the most output in your SAS log with your compiled and executed code:
If you have a particular need to use SAS macro language facilities, it's best to get your code working without macros, understand the flow such that it works properly, and then decide what's needed with macros, if at all, to enhance or make your program more effective/efficient by using SAS macros and macro variables.
Recommended Google advanced search arguments, this topic/post:
You can't run proc sql inside a data step, think about it.
2 ways to do what you want:
Either look up the data some other way (no need to call a macro to look up data), or if you need to do more complex things in your macro, it has to be pure macro language for the data step to run it immediately.
This does both:
input id D1 $ D2 $ D3 $;
1 A B C
2 D E F
3 G H I
4 J K L
5 M N O
6 P Q R
7 S T U
8 V W X
9 Y Z A