IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Declaration of variables used in Call statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Mon Jun 27, 2005 9:57 am
Reply with quote

Hi Folks,

if we call one subprogram by using call statement.
is there any specific declaration required in sub program/main program.
tell me the reason for both static and dynamic calls..please.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Mon Jun 27, 2005 10:40 am
Reply with quote

hi,
For a program to sub program , you need to give program type as subroutine or service. It should not be mainline.
for static and dynamic call, please search in the forum, you will get lot of result. One of them is
www.ibmmainframes.com/viewtopic.php?t=3105&highlight=static
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Mon Jun 27, 2005 11:07 am
Reply with quote

Hi kanak,

My question is different.
Am not worrying abt STATIC/DYNAMIC calls.
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Tue Jun 28, 2005 12:32 pm
Reply with quote

Doen we need to give any declarations in sub program and main program.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Tue Jun 28, 2005 12:50 pm
Reply with quote

sorry babuprasad_g,
Well you are calling program statically then you don't need to give any declaration of sub program in mainline, where as in case of dynamic you need to give a declaration in workign storage section.
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Tue Jun 28, 2005 1:03 pm
Reply with quote

Hi kanak,

if it is static call just we use

CALL SUB-PROG

if it is dynamic call

01 WS-SUB PIC X(8).

MOVE SUB-PROG TO WS-SUB.

then we

CALL WS-SUB USING WS-SUB-VAR01,WS-SUB-VAR02.

Is it right. other than these declaration we need to give any declarations/not.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Tue Jun 28, 2005 1:24 pm
Reply with quote

no that much is enough. One thing i would like to point out is in static call we need to give
call 'sub-prog'
where in dynamic call it is
call ws-sub-prog
Back to top
View user's profile Send private message
babuprasad_g
Currently Banned

New User


Joined: 26 May 2005
Posts: 45
Location: gurgaon

PostPosted: Tue Jun 28, 2005 1:38 pm
Reply with quote

Thank you kanak.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jun 28, 2005 11:13 pm
Reply with quote

I've seen these examples of pgm CALLs using hyphenates names. This is confusing to those who don't understand the CALL concept.

For example SUB-PGM looks like a data variable name not a literal. So whe someone writes CALL 'SUB-PGM' it might be confused w/a variable. The usual convention is CALL 'subpgm' or CALL 'literal'.

A fine point but worth noting.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts JCL with variables JCL & VSAM 1
Search our Forums:

Back to Top