Learning macros forces us to learn more about how SAS (and other programming languages) process these different types of variables. First when SAS runs your code it runs in phases. Long story short, there's a "macro preprocessor" phase (see note) where the macro variables and macro functions are defined and applied to the code. In later phases, the "compile and execution" phases, the data steps and procedures are compiled and then ran.
When the macro function you created runs, it "SAS" can't know that RDE_LEN is a variable in the data step, nor can it know any of its future values. SAS only knows that RDE_LEN is a variable in the data step during the compile phase, where, then, it assigns 3000 to the RDE_LEN.
So what @PaigeMiller wrote is true, I think I'm filling in some of the holes in the story. We try to explain things as simply as we need to. I hope I hit that target with this.
note: excuse me, there might be another term for the "macro preprocessor" phase. I have searched but I can't find where I learned this. I think I remember seeing a SAS tutorial explaining it, but then I could have seen the same in a C programming class in college.
... View more