Folks, I have a problem regarding calling a macro from data step. This data step is inside another macro. But fundamentally , it is not possible to get macro value in ‘data step’, although some alternate like ‘call execute’ can be used. But I am not able to get it done. I have below code which is not working and making data variable set empty instead of returning value. Is there any alternative to achieve so ? %Macro Set_nestedval2(TaskID,Status,Section,DSNameP,DSVarP,DSVarP1); /*%let location_1=%location('Train'); */ Data &DSNameP; Set &DSNameP ; &DSVarP=call execute('%nrstr(%location(type=Train));'); /* &DSVarP=& location; */ Run; %put &location_1; %mend; %macro location(type,location=); %if &type='Airplane' %then %let location=Airport; %if &type='Train' %then %let location=Railway_Station; /*%put type is &type.; */ &location; /* this line is effectively the "return value" */ %mend location; %Set_nestedval2(1,2,3,’DM’,’Entity_name’,’’); Thanks,
... View more