I have a piece of code that I want to use, possibly inside and outside of data steps. In order to use "DOSUBL" I need to check whether I'm inside a data step or not. I know it doesn't sound great, but just bare with me. I've tried SYSLAST etc but it doesn't work. data test1;
set test;
%com(blah blah blah);
%macro com /parmbuff;
***WOULD LIKE TO INSERT CODE HERE TO CHECK IF I'M INSIDE DATASTEP****
rc = %sysfunc(dosubl(
*extra code*
));
%mend com;
run; I've tried changing it to macro code such as: data test1;
set test;
%com(blah blah blah);
%macro com /parmbuff;
%let rc = %sysfunc(dosubl(
*extra code*
));
%mend com;
run; But constantly got the errors: NOTE: One or more missing close parentheses have been supplied for the %DOSUBL function. ERROR: Expected close parenthesis after macro function invocation not found. & yes i did have the same amount of open brackets as i did closed. It should be noted that inside the *extra code section* I have data steps, let statements, macro do's etc. Wondering if anyone knows of any functions that would help me do this. I was thinking if there was something to check if last data step was closed or something. I'm a bit unsure what I'm looking for, so open to suggestions. (Please don't ask me why its confusing and will sound silly to anyone not working on it)
... View more