07-16-2014 09:29 AM
I have run into an issue while trying to create a function that calls a macro.
proc sql noprint;
where pay_for_perf_grp_id = &a;
/*where pay_for_perf_grp_id = &a;*/
PROC FCMP outlib=shared.funcs.test;
function tester(a) $;
IF rc = 0 then return(name);
test = tester(pfp);
The idea is that there are ID's that are attached to names and I want the function to be able to call an oracle table and retrieve the names based on the functions.
I get no errors from running the code, but I get blanks as a result. If I change the function to pull the ID's instead and remove the $ then it does work (returns the ID's).
For the macro I tried using both the data step and PROC SQL and both came up with the same result. When I used a %put to see if it was working it showed that it was pulling the correct name. I have also changed the length of the return variable in the function statement and that does not work either.
Not sure what is going on.
The log indicates that when the variable is being pushed from the macro to the function it is being converted from a numeric to a character. However, I am wondering at what point did it ever become a numeric?
Need further help from the community? Please ask a new question.