a macro can "do things" and/or return text.
It does "all that" at data-step compile-time.
So a %macro can't provide a log() of a run-time value, like a data set variable or DSDV(data step data vector) variable value.
yes. I have a dataset "one" containing all parameter information. I have a %macro step, which i can use to calculate the area under the Sin/Cos curve for each order. I have to check my output statement to see those values of AUC. I hope to get a dataset as "final":
Well, I have a disconnect between the example you originally posted and the macro code that you posted just now. In the original example, your code implied that the macro program was returning 1 value:
Which would argue for PROC FCMP and a user-defined function definition.
But in the macro you just showed (%AUC_hyper_), the macro program has a DATA step, a PROC SUMMARY step which creates WORK.P1 and then a PROC PRINT on dataset P1). Where did you envision the variable VALUE1 would get a value FROM???? From WORK.P1??? From WORK.F1???
What is $ORDER??? Where do the values for &N and &HBOUND come from???
Conceptually, you would be asking the macro facility to do something like this:
value1 = insert ALL the code from
%AUC_hyper_(a,b,n,hBound, order ) macro program
...which just will NOT work. Now, if you want to iterate through every observation in SET WORK.TEST2 and invoke the %AUC_hyper_ for every observation in WORK.TEST2, then you will want to read about the CALL EXECUTE method of placing macro code in the program stack and you will REALLY have to understand the timing issues of using CALL EXECUTE (such as the CALL EXECUTE will execute AFTER the DATA TEST1 step executes).
Remember that the macro program will get invoked at program COMPILE time and will result in resolved code being written to the DATA step program. The SAS Macro facility is very useful for text substitution and for generating repetitive statements, but what you envision doing requires an understanding of the difference between macro compile time, macro execution time, data step compile time and data step execution time and what happens during each phase of the process. So, in order to help with SAS macro questions it would be essential to actually see the full text of the %my_macro definition and for you to explain what the macro is supposed to do. (Also, since the question does involve SAS macro processing --and not SAS Procedures -- you might want to repost this question with more information in the SAS Macro forum).