Hi, Thanks for the response. As I explained the proc fcmp is working well with proc optmodel on my Windows PC but the error appears when I run it on UNIX server using rsubmit. I believe the problem is not generated from proc optmodel but it's only from the remote submit of proc fcmp since when I run the following code I get the same error (ERROR: Cannot find a library containing subroutine RUN_MACRO.). rsubmit ; proc fcmp outlib=xwork.ds.functions; function Tot_profit(V5YC, F1YC, F2YC, F3YC, F4YC, F5YC,seg $,peak,Num_comp_periods,Num_pay_period_year,Discount_rate,Free_Appr_cost,Amex_Point_Cost,cash_back_cost); rc = run_macro('Profit',V5YC, F1YC, F2YC, F3YC, F4YC, F5YC,seg,peak,Num_comp_periods,Num_pay_period_year,Discount_rate,Free_Appr_cost,Amex_Point_Cost,cash_back_cost,Sum_profit2,NII2,Vol2); if rc eq 0 then return(Sum_profit2); else return(.); endsub; endrsubmit; The reason that I'm using proc fcmp (called "Tot_profit") to create a function which calls a macro function (called "Proft"). The Tot_profit function is later called from proc optmodel to calculate the objective function and the input arguments to that function is the optimization variables and the outcome is the objective value which is supposed to be maximized. If I just call the macro function directly from the proc optmodel without utilizing the function created by proc fcmp then I get the following error message for any line of code I add after calling the macro function. ERROR 180-322: Statement is not valid or it is used out of proper order. So please let me know your thoughts about the first error message from remote submit of proc fcmp and also if you have any suggestion for calling a macro function during optimization directly from proc optmodel without utilizing proc fcmp. Thanks, Farshid ##- Please type your reply above this line. Simple formatting, no attachments. -##
... View more