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
 

 

Mapping of data passed between programs

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

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Fri May 04, 2007 8:00 pm    Post subject: Mapping of data passed between programs
Reply with quote

Let me put my query by an example:

Program A
=======

01 VAR-A1 PIC X(30).
01 VAR-A2 PIC X(30).
01 VAR-A3 PIC X(30).
01 VAR-B PIC X(10).
01 VAR-C PIC X(10).

CALL 'PROGRAM B' USING VAR-A1,
VAR-A2,
VAR-A3,
VAR-B,
VAR-C.

Program B
=======

01 VAR-A PIC X(30).
01 VAR-B PIC X(10).
01 VAR-C PIC X(10).

PROCEDURE DIVISION USING VAR-A,
VAR-B,
VAR-C.

In such a situation, Will the VAR-B and VAR-C get the same values passed from Program-A?
And how does this match and works?
I am not getting any error and the program is running fine.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Fri May 04, 2007 8:18 pm    Post subject: Re: Mapping of data passed between programs
Reply with quote

Nagendran wrote:
In such a situation, Will the VAR-B and VAR-C get the same values passed from Program-A?
And how does this match and works?
I am not getting any error and the program is running fine.
In progb, var-b is looking at the first 10 bytes of var-a2 and var-c is looking at the first 10 bytes of var-a3. Progb has no (simple) access to proga's var-b or var-c.
Is this what you wanted?
Back to top
View user's profile Send private message
Nagendran

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Fri May 04, 2007 8:41 pm    Post subject: Re: Mapping of data passed between programs
Reply with quote

Are you telling this because it is a CALL BY REFERENCE?

Okie...

In my case, i ran my program and in it VAR-A of Program B takes any one (depending on some logic) VAR-A1 or VAR-A2 or VAR-a3 of Program A, and VAR-B of Program B taking exactly VAR-B of Program A, and VAR-C of Program B is taking exactly VAR-C of Program A.

Could comment on this?

Both of my programs are IMS programs and the VAR-A* are PCB's actually.
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 May 04, 2007 9:01 pm    Post subject:
Reply with quote

Hello,

It is a very good practice to ensure that the calling code and the called code have the same "parameter" definition.

Keep in mind that the field names are not used when the call is issued at execution (the compiler needs field names, but the execution does not), using the same field names in both modules is for programmers to more readily understand not the computer.

Please let us know if you have questions.
Back to top
View user's profile Send private message
Nagendran

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Fri May 04, 2007 9:37 pm    Post subject: Re: Mapping of data passed between programs
Reply with quote

Dick,

You are absolutely right.

During my execution time, i got it like how i explained in the previous posting. I just wanted to reason it out.
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: Sat May 05, 2007 12:05 am    Post subject:
Reply with quote

That's one of the reasons we're here icon_smile.gif

See you another time,
Back to top
View user's profile Send private message
Nagendran

New User


Joined: 24 Jan 2007
Posts: 89
Location: USA

PostPosted: Sat May 05, 2007 12:30 am    Post subject: Re: Mapping of data passed between programs
Reply with quote

very kind of you.... :D
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts Why myself doing Package Bind always ... Susanta DB2 5 Thu Mar 02, 2017 10:47 pm


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