Multiple procedure

Hi,

I want to utilize more than two procedures. Is it possible?

Although I tried like this, error occurs.

 

proc lik_fcn_a (prmtr1);
local prmtr1, a  ;
~~
retp(~~);
endp;

proc lik_fcn_b (prmtr2);
local prmtr1, a  ;
~~
retp(~~);
endp;

 

This is error statement.

"Nested procedure definition G0155"

 

Please help me

1 Answer



0



You can certainly define multiple different procedures in the same GAUSS file. For example, if you make a new file with this content:

//Define two very simple procedures
proc lik_fcn_a(prmtr1);
    local a;
    a = 5;
    retp(a * prmtr1);
endp;

proc lik_fcn_b(prmtr2);
    local a;
    a = 1;
    retp(a * prmtr2);
endp;

It will run successfully. However, I think there is more to your question that I am not understanding. Are you wanting to have a procedure that calls another procedure? Or do you want to access variables from one procedure inside of another?

aptech

1,773

Your Answer

1 Answer

0

You can certainly define multiple different procedures in the same GAUSS file. For example, if you make a new file with this content:

//Define two very simple procedures
proc lik_fcn_a(prmtr1);
    local a;
    a = 5;
    retp(a * prmtr1);
endp;

proc lik_fcn_b(prmtr2);
    local a;
    a = 1;
    retp(a * prmtr2);
endp;

It will run successfully. However, I think there is more to your question that I am not understanding. Are you wanting to have a procedure that calls another procedure? Or do you want to access variables from one procedure inside of another?


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.