Difference between Static call and dynamic call



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Difference between Static call and dynamic call

Postby Shakthivel V » Thu Mar 11, 2010 11:36 pm

Hi , Can anyone please give clear picture on difference between Static call and dynamic call ?
Shakthivel V
 
Posts: 22
Joined: Thu Mar 04, 2010 12:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: STATIC CALL VS DYNAMIC CALL

Postby ITConsultant » Thu Mar 11, 2010 11:43 pm

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.
ITConsultant
 
Posts: 15
Joined: Wed Mar 10, 2010 4:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: STATIC CALL VS DYNAMIC CALL

Postby Shakthivel V » Thu Mar 11, 2010 11:52 pm

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?
Shakthivel V
 
Posts: 22
Joined: Thu Mar 04, 2010 12:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: STATIC CALL VS DYNAMIC CALL

Postby ITConsultant » Fri Mar 12, 2010 12:04 am

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.
ITConsultant
 
Posts: 15
Joined: Wed Mar 10, 2010 4:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: STATIC CALL VS DYNAMIC CALL

Postby Robert Sample » Fri Mar 12, 2010 12:19 am

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?
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: STATIC CALL VS DYNAMIC CALL

Postby Shakthivel V » Fri Mar 12, 2010 12:27 am

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??
Shakthivel V
 
Posts: 22
Joined: Thu Mar 04, 2010 12:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: STATIC CALL VS DYNAMIC CALL

Postby Robert Sample » Fri Mar 12, 2010 1:27 am

If you are using CALL variable-name and not CALL 'program name' then you are doing a dynamic call.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: STATIC CALL VS DYNAMIC CALL

Postby Shakthivel V » Fri Mar 12, 2010 1:33 am

I am clear now .. Thanks ..
Shakthivel V
 
Posts: 22
Joined: Thu Mar 04, 2010 12:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: STATIC CALL VS DYNAMIC CALL

Postby dick scherrer » Fri Mar 12, 2010 2:16 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post