Here is an example using customer building function that return multiple values to optmodel.
options cmplib=sasuser.funcs2;
****test subroutine return values to optmodel;
proc fcmp outlib=sasuser.funcs2.profit;
subroutine test (a,b1,b2,b3);
outargs b1-b3
;
b1=a*1;
b2=a**2;
b3=a**3;
;
ENDSUB;
run;
proc optmodel;
set I init 1..4;
set J init 1..3;
number a{p in I, q in J} init p, q;
number x{p in I} init p;
print x a;
for {p in I} call test(x[p], a[p,1], a[p,2], a[p,3]);
print a;
quit;