Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Declaration of variables used in Call statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Declaration of variables used in Call statement
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    Post subject:
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
http://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    Post subject: this is not a perfect answer.
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    Post subject: my question is
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    Post subject:
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    Post subject: Small clarification need
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    Post subject:
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    Post subject: Thank you kanak
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us