11-15-2013 08:44 AM
Perhaps you can explain more why you want "nested data step", as there are likely other ways to create SAS code to handle your situation.
For example, you can have a subroutine within a SAS data step, using the LINK command. Macros also provide a way to create "nested" code or subroutines.
11-15-2013 09:44 AM
I want to call a macro from data step 1 which takes input from a table called in data step1.
This macro runs data step2 which would ultimately create some global macro variable
which i want to use in data step1.
It is possible to call data step 2 from data step1 using macro and I could actually create those global macro variable.
But I am not able to use those created macro variable in data step1.
BTW thanks for your reply
11-15-2013 10:04 AM
I have created a macro which takes some input and do some calculation using data step and returns a macro variable (generated in data step using call symputx).
I want to run this macro over lots of values which are stored in a table (say test) and to update the table test with macro output.
11-15-2013 10:20 AM
Without more details, I can't be sure, but it still seems to me like the LINK command allows you to do this in a single data step, without macro variables at all.
I have created a macro which takes some input and do some calculation using data step
It would be very helpful at this point if you could explain what the macro does, what calculations are performed, and where the data comes from that the macro uses; and is this the same data set that you are mentioning that needs the macro variable later?