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
 

 

No of Variables in Calling and Called Programs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Wed Aug 08, 2007 8:57 pm    Post subject: No of Variables in Calling and Called Programs
Reply with quote

Hi,

Is that mandatory that no of variables passed from Calling to Called Program should be equal.

Is this criteria apply to both Static as well as Dynamic Calls.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Wed Aug 08, 2007 9:04 pm    Post subject:
Reply with quote

not only the number, but their position in the USING phrase is also important. It seems that you have not bothered to read the documentation. Links to appropriate language manuals are at the top of this page.
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Wed Aug 08, 2007 9:31 pm    Post subject: Re: No of Variables in Calling and Called Programs
Reply with quote

I think position is not important...... only the no matters.

Say

Pgm A:

Call B using 1,2,3

Pgm B:

Procedure division using 2,1,3

This will work....

Here we are refrencing the allocated memory locations
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Aug 08, 2007 10:00 pm    Post subject: Re: No of Variables in Calling and Called Programs
Reply with quote

rajaherein wrote:
I think position is not important...... only the no matters.
Say
Pgm A:
Call B using 1,2,3
Pgm B:
Procedure division using 2,1,3

This will work....
Here we are refrencing the allocated memory locations
Wrong answer, if Pgm B is expecting the data area that Pgm A refers to as 1 to be in the second location, it will fail.
Besides, the number of items is not as critical, only the reference to items that do not exist.
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Thu Aug 09, 2007 11:02 am    Post subject: Re: No of Variables in Calling and Called Programs
Reply with quote

Hi William,

Per your suggestions, the length of data area is important rather than numbers.

Please advice.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 10, 2007 12:05 am    Post subject:
Reply with quote

Hello,

Position in the parameter sequence is critical as well as the definition of the parameter at each position. What may not be critical is if a called module is set up to handle 5 parameters and only the first 3 are used in a particular call. If the called module does not refer to parameter4 and parameter5, there should be no problem. This is sometimes seen when some sort of "service" module is called that can support a variety of functions and they do not all require all of the parameters. Typically, the first parameter has info that tells the callee what is being requested.

My preference is that the caller and the callee have the same definitions.
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Fri Aug 10, 2007 10:40 am    Post subject: Re: No of Variables in Calling and Called Programs
Reply with quote

Hi Dick,

Thanks for your advice.

According to my observations, when the Called module has 5 parameters and Calling module has 3 parameters, then S0C4 occurs.

Correct me if i am wrong.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 10, 2007 6:27 pm    Post subject:
Reply with quote

Hello Raj,

Yes. Typically, that happens when the called module tries to use the 2 parameters that were not passed. As i mentioned
Quote:
If the called module does not refer to parameter4 and parameter5, there should be no problem.

if the called module has 5 parameters and the caller only sends 3, the called module must have a way to know which parameters were used and ensure that parameters 4&5 are not used in that invocation.
Quote:
Typically, the first parameter has info that tells the callee what is being requested


Please let me know if i've not been clear.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Aug 10, 2007 6:45 pm    Post subject:
Reply with quote

Does standard linkage in the current COBOL still set the high bit to 1 on the last passed address?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Fri Aug 10, 2007 7:06 pm    Post subject:
Reply with quote

icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif have you checked? icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 10, 2007 8:43 pm    Post subject:
Reply with quote

Ouch icon_lol.gif

Or as kids in my old neighborhood would chant, "Nyah Nyah Nyah, Ny Nyahh Nyahh". . . .
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Thu Aug 16, 2007 1:16 pm    Post subject:
Reply with quote

Hello Dick,

Many Thanks, i got my doubts cleared by your comments.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Aug 16, 2007 8:49 pm    Post subject:
Reply with quote

Quote:

Does standard linkage in the current COBOL still set the high bit to 1 on the last passed address?


It may, but all the object code that I have seen only generates setregs based on the USING list in the invoked modules PROCEDURE DIVISION statement. Since you can call with three and by called using only 2 - which will work and call with 3 and be called using 4 and receive a SOC4, I assume that the high-bit (if set) is never checked.
Back to top
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Tue Aug 21, 2007 7:44 pm    Post subject:
Reply with quote

Say

Pgm A:

Call B using 1,2,3

Pgm B:

Procedure division using 1,2

This will work....
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 Why myself doing Package Bind always ... Susanta DB2 5 Thu Mar 02, 2017 10:47 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm


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