I am trying to figure out how I can use a global variable while using NLPTR. I have added code snippet below. I am able to access global variable (x) from within funcB if I have no arguments to funcA. I understand the explanation around the global and the local variable tables. But is there a way around this limitation. I can't pass x as an argument to funcB in my code as nlptr will only let me pass more than 1 arguments. The other solution I have to use the funcA completely. But then my code won't be modular.
proc iml;
z = 10;
start funcA(z);
x = z/2;
start funcB(a,b) global(x);
b = a + x;
print 'In Function B' b;
finish;
a = 10;
call funcB(a,b);
print 'In Function A' b;
finish;
run funcA(z);
quit;