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
 

 

Query about how data passed in CICS/COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Query about how data passed in CICS/COBOL
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

Site Director


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

PostPosted: Thu Mar 12, 2009 10:36 am    Post subject:
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: 95
Location: India

PostPosted: Thu Mar 12, 2009 3:19 pm    Post subject:
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: 7995
Location: Bellevue, IA

PostPosted: Thu Mar 12, 2009 4:54 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Mar 12, 2009 6:28 pm    Post subject: Re: Query about how dat passed in CICS/COBOL
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Mar 12, 2009 8:31 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Mar 12, 2009 8:39 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Mar 12, 2009 9:23 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Mar 12, 2009 9:42 pm    Post subject:
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    Post subject: Reply to: Query about how dat passed in CICS/COBOL
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions 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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


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