11-15-2013 07:48 AM
It is actually arguably possible to nest datastep with SAS9.2 but it requires tedious efforts.
Using PROC FCMP, you can create a routine that you can call in your outer data step.
With the RUN_MACRO and dosubl tools in proc FCMP, you can force SAS to execute the inner data step that you would preemptively have wrapped in a macro. The RUN_MACRO allows you to execute the macro right away rather than piling it up to be executed at the end of your current data step like with call execute.
Typically, there would be other better ways around so if you are not an experienced SAS user, you would probably be better detailing the intention behind your code as there are very likely ways around that. However, if you are in for a nice self-learning experience, look into