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

Query about how data passed in CICS/COBOL


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Thu Mar 12, 2009 10:28 am
Reply with quote

If there is a program A, which triggers program B with a transaction, but there is no data or commarea being passed to B. How can program B access the storage address/data present in commarea of A?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Mar 12, 2009 10:36 am
Reply with quote

Hello,

Why should an independent program have any access to some other program?

If program B needs access to something from program A, they both need to follow some convention. . .
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Thu Mar 12, 2009 3:19 pm
Reply with quote

If there is no data or commarea passed to B program, then it can't access the commarea storage of A program. As Dick advised what is the neccessary of calling B program when an independent program have any access to some other program.

Please correct me if am wrong
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 12, 2009 4:54 pm
Reply with quote

There's a term in CICS for the case of program B attempting to access program A's COMMAREA or other data, and that term is STORAGE VIOLATION. CICS specifically protects against this type of access.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Thu Mar 12, 2009 6:28 pm
Reply with quote

sachin.mandaliya wrote:
If there is a program A, which triggers program B with a transaction, but there is no data or commarea being passed to B. How can program B access the storage address/data present in commarea of A?
As Robert said, that could end up being a storage violation.
But, if protected or in some way made available, the address could be saved by A in a TS/TD queue that B could retrieve.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Thu Mar 12, 2009 8:16 pm
Reply with quote

if you do get addressability to Program A's working storage from a
different transaction.

move some data to it from Program B. Let us know what happens !!

icon_lol.gif
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Mar 12, 2009 8:31 pm
Reply with quote

Quote:
But, if protected or in some way made available, the address could be saved by A in a TS/TD queue that B could retrieve


But what could protect it? This is a storage area of a task that may well have ended, freeing up all its storage. The passed pointer could be pointing at anything! If Task A continues for long enough, in parallel to Task B, what's to prevent either from modifying storage that the other's using?

If storage could be protected past task-end, how could clean-up be achieved? There may be potential for a memory-leak here....

Garry.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Thu Mar 12, 2009 8:39 pm
Reply with quote

Garry Carroll wrote:
But what could protect it? This is a storage area of a task that may well have ended, freeing up all its storage. The passed pointer could be pointing at anything! If Task A continues for long enough, in parallel to Task B, what's to prevent either from modifying storage that the other's using?
Minor design problem, but it is solvable. For instance, task A starts non-terminal B and then waits on an ECB for B to finish....
Quote:
If storage could be protected past task-end, how could clean-up be achieved? There may be potential for a memory-leak here....
Proper design would prevent attempted access to freed storage.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Mar 12, 2009 9:23 pm
Reply with quote

Quote:
For instance, task A starts non-terminal B and then waits on an ECB for B to finish....

Yes, but isn't this kinda like going back to conversational technique? All that program and task storage tied-up while waiting for Task B to POST the ECB ! A bit like hogging storage while waiting for the terminal user to return from coffee/lunch...

I guess we're only discussing theoretical ways of doing something that can be better achieved by proper design in the first instance.

Garry.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Thu Mar 12, 2009 9:42 pm
Reply with quote

Quote:
Yes, but isn't this kinda like going back to conversational technique?
In an application I worked on, the CICS transaction was entirely pseudo-conversational but had to wait for either the other task to succeed or timeout. The other task did an external request to another site that sometimes failed to complete in a timely manner.
Back to top
View user's profile Send private message
sachin.mandaliya

New User


Joined: 17 Jan 2007
Posts: 24
Location: India

PostPosted: Tue Mar 17, 2009 2:43 pm
Reply with quote

Thanks guys for your answers....

Actually I have been asked this question in some interview and I had some doubts about it. Now they are cleared.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Wed Mar 18, 2009 5:22 am
Reply with quote

Sachin,

out of courtesy, please identify with original posting for questions that come from an interview process.
icon_biggrin.gif
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top