Q: return and assign global value from macro function in data setp Not quite sure the best way to do the following - I want to call a macro function from within a DATA step, passing as an argument the value from an existing column, and assign the value generated by the macro function to a new column. I'm open to any approach - PROC SQL, CALL EXECUTE, etc. 
%macro simple(x=);
    %global value;
    %let value = %sysfunc(intnx(month, %sysfunc(today()), &x, same)); 
    %put &value;
%mend simple;
%simple(x=1);

data have;
    do x = 1 to 15;
        output;
    end;
run;

data want;
    data have;
        newdate = %simple(x);
run;


A: If you want to use the macro in the middle of a statement like:
newdate = %simple(x);

then the macro can only emit part of a statement. That is no semi-colons.
In this case if you define the macro to generate the call to INTNX() then you could use it that way in an assignment statement.
%macro simple(value);
  intnx('month',%sysfunc(today()),&value,'same')
%mend simple;

So if today() is 20NOV2018 then you are effectively running this valid SAS statement in your data step.
newdate = intnx('month',21508,x,'same') ;

Notice how the name of the variable X is what is passed to macro and what is used in the generated piece of SAS code.
Of course your macro is now useless if you wanted to try to use it outside of a SAS statement.  

A: Notice the changes to %SIMPLE and where it is called.  RESOLVE works for this case but
%COMPLEX :-) will not.  Also this is better done without calling a macro it can all be done in data step.  I hope you have a better use for this than job security.
%macro simple(x=);
   %sysfunc(intnx(month, %sysfunc(today()), &x, same))
   %mend simple;

%put NOTE: %simple(x=1);

data have;
    do x = 1 to 15;
        output;
    end;
run;

data want;
   set have;
   newdate = input(resolve(cats('%simple(x=',x,')')),F16.);
   format newdate date9.;
   run;
proc print;
   run;

