Page 1 of 1

Difference between Static call and dynamic call

PostPosted: Thu Mar 11, 2010 11:36 pm
by Shakthivel V
Hi , Can anyone please give clear picture on difference between Static call and dynamic call ?

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Thu Mar 11, 2010 11:43 pm
by ITConsultant
Please read the manual for "official" explanation but here is an example:

Static call example:

Call 'progabcd' using ...

Dynamic call example:

Working Storage:

01 prognames.
05 prog-1 pic x(08) value 'progabcd'.

Procedure Division.

.
.
.
Call prog-1 using ....

You also need to compile static with nodynam option and dynamic with dynam option.

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Thu Mar 11, 2010 11:52 pm
by Shakthivel V
Thanks.. From JCL i want to pass the program name in that case
01 prognames.
05 prog-1 pic x(08)

is placed in linkage section right?

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Fri Mar 12, 2010 12:04 am
by ITConsultant
can you explain your situation a little more? I am not sure why you would want to pass a sub-module name from the JCL - to me that is very unusual.

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Fri Mar 12, 2010 12:19 am
by Robert Sample
Find the COBOL manuals and read up on passing parameters from JCL. If you are using the PARM=, you must also have a 2-byte binary (COMP) field at the start which will contain the length of the parameter, and you must change your PROCEDURE DIVISION to include the USING clause.

And I echo the earlier comment -- WHY ON EARTH WOULD YOU WANT TO PASS A SUBROUTINE NAME FROM JCL?

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Fri Mar 12, 2010 12:27 am
by Shakthivel V
Thanks Robert.. my question is passing parameters from JCL and PROCEDURE DIVISION to include the USING clause and i am using that parameter in CALL statement , then its dynamic call rite??

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Fri Mar 12, 2010 1:27 am
by Robert Sample
If you are using CALL variable-name and not CALL 'program name' then you are doing a dynamic call.

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Fri Mar 12, 2010 1:33 am
by Shakthivel V
I am clear now .. Thanks ..

Re: STATIC CALL VS DYNAMIC CALL

PostPosted: Fri Mar 12, 2010 2:16 am
by dick scherrer
Hello,

Robert wrote:If you are using CALL variable-name and not CALL 'program name' then you are doing a dynamic call.


Shakthivel V wrote:I am clear now ..


Note that dynamic/static has nothing to do with the execution JCL. . .