MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use of Binary Search of table in CICS Shared Storage

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
bstillwa
Beginner


Joined: 01 Nov 2004
Posts: 23
Topics: 6
Location: NJ

PostPosted: Mon Nov 22, 2010 9:58 am    Post subject: Use of Binary Search of table in CICS Shared Storage Reply with quote

We are attempting to use COBOL logic in CICS that was originally written to work in Batch, where the programs are now reuse=re-entrant. A table is being stored in CICS shared/main storage for use throughout the day. This table is being searched using a SEARCH ALL (logic written for Batch use).
The table is defined:
10 ECA06-L-ID-MOD-ENTRY OCCURS 3000 TIMES
ASCENDING KEY ECA06-L-FLD-ID-MOD
INDEXED BY ECA06-INDEX-L.

I have a concern that the Index which is defined within this table could be being used by more than one transaction at the same time. Is this a valid concern? Should the logic instead use a SEARCH which would use a working-storage index?

The table being searched can contain a maximum of 3000 entries, but at present actually contains only 1336 entries. For a table of this size, is there any performance gain by using SEARCH ALL over SEARCH?
_________________
Bev.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Nov 22, 2010 12:23 pm    Post subject: Reply with quote

bstillwa,

This is what I think, others please correct me if I am wrong.

Quote:
A table is being stored in CICS shared/main storage for use throughout the day. This table is being searched using a SEARCH ALL (logic written for Batch use). ...
I have a concern that the Index which is defined within this table could be being used by more than one transaction at the same time.


You only load the data, not the index. Table definition and search criteria are local to your program so it should not matter how many transactions are using it.

Quote:
Should the logic instead use a SEARCH which would use a working-storage index?


Not required.

Quote:
The table being searched can contain a maximum of 3000 entries, but at present actually contains only 1336 entries. For a table of this size, is there any performance gain by using SEARCH ALL over SEARCH?


With 3000 entries, in worst case you would need to loop 12 times through the table to locate your data by binary search. Normal search would require 3000. Now you decide.
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
bstillwa
Beginner


Joined: 01 Nov 2004
Posts: 23
Topics: 6
Location: NJ

PostPosted: Mon Nov 22, 2010 12:29 pm    Post subject: Reply with quote

The Search Criteria are local to my programs, but the Key and Index are not local to my programs. The Key and Index are located in Shared Storage. Therefore repeating my concern: could the Key and Index be being used by more than one transaction (and/or program) at the same time?
_________________
Bev.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Nov 22, 2010 12:38 pm    Post subject: Reply with quote

bstillwa,

suggest you do some reading.

you keep saying the the key and the index are located in shared storage.
prove that statement.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
bstillwa
Beginner


Joined: 01 Nov 2004
Posts: 23
Topics: 6
Location: NJ

PostPosted: Mon Nov 22, 2010 12:56 pm    Post subject: Reply with quote

Please then point me to the manual where it states that the key and index used in a binary search are never located in shared storage for a table defined and used in this manner (instead of responding with a degrading tone). Please try to be helpful. This is confusing me because the area where the table, key and index are all defined does indeed reside in shared storage. Any time this table is used, the beginiing of it is pointed into shared storage (via an address which is stored in the CWA), by use of SET ADDRESS.
_________________
Bev.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Nov 23, 2010 3:46 am    Post subject: Reply with quote

I used the tone because you have little knowledge (refuse to increase it) and only want to hear what sounds good.

the shared storage area is nothing but a data storage area.

the definitions of the data relationships (size, data type, etc...), the organization of the data, the definition of the 'keys' and the use or non-use of indexes is accompished in the COBOL program via the data defintions provided for the OCCURS clause.

That you have not grasped these fundamental concepts bodes ill for your potential to solve this problem.

you were told NO, twice, yet you persist on your course of inquiry, driven by you lack of understanding.
again, suggest you do some reading and thinking.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue Nov 23, 2010 2:47 pm    Post subject: Reply with quote

Quote:

Please then point me to the manual where it states that the key and index used in a binary search are never located in shared storage for a table defined and used in this manner
Why would you believe that things that do not happen would be written about in the manual(s)? Neither IBM nor any other software provider could possibly document all of the "things" that do not happen. . .
Quote:

This is confusing me because the area where the table, key and index are all defined does indeed reside in shared storage.
The confusion is due to the lack of knowledge/understanding. As DBZ mentioned, you should do research. If you post your assumption, you need to be able to demonstrate this - not question why the documentation is not written as you might prefer.

Suggest you run some experiments and if anything unexpected happens, post what happened. Someone should be able to clarify.
_________________
All the best,

di
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Mon Nov 29, 2010 5:43 am    Post subject: Reply with quote

Hi,

Out of eagerness and not with outstanding knowledge in CICS on ADDRESS, just wanted to know what exactly is the issue?

And with what I understood, It looks like the table defined here is like a Queue which can be accessed by multiple transaction. So, if a read is done on the table with any KEY and INDEX then that value becomes local to that transaction which will not affect other transaction operation (As each transaction have got their own TWA and other space allocation).

Please correct if I going wrong anywhere.

Thanks,
Computer
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Nov 29, 2010 1:10 pm    Post subject: Reply with quote

Computer, I have not written these types of programs but only supported them so you would probably need to verify what I am saying.


Quote:
It looks like the table defined here is like a Queue which can be accessed by multiple transaction.


Not like a queue, but more like a working storage area. In assembler you can write a program that contains just data and no executable (more like defining Cobol working Storage) and then assemble and link edit the program.

Then you can load this data in Cobol or any other program using EXEC CICS Load where the Set option of load is used to map the data to Cobol storage, it would be ECA06-L-ID-MOD-ENTRY for the original post.

Quote:
So, if a read is done on the table with any KEY and INDEX then that value becomes local to that transaction which will not affect other transaction operation (As each transaction have got their own TWA and other space allocation).


Right.
_________________
Regards,
Diba
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group