I have a macro(MyMacro) which I need to execute for a variable in each observation of the dataset.
So I have a data set block like below...
The Macro seems to be executing for only one observation(I have 4 observations in the files data set). This may be because of the run statement I have after symputx statement. But without that run statement, symputx does not execute and hence folderPath does not get resolved.
You say your program "fails" but it's not been clearly stated as to what fails.
It would be best served if you shared the SAS log information where you get the erorr and include expanded SAS code for subscribers / visitors to see -- also explain what the DATA step is attempting to accomplish in your words.
And, add to your program for the most expanded info possible (maybe this will also help with self-debugging?):
OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN;
It is possible to invoke a macro multiple times so that it is expanded / resolved within a DATA step (that is between a DATA statement and a RUN statement).