View previous topic :: View next topic
|
Author |
Message |
sid_aec
New User
Joined: 01 Jul 2008 Posts: 60 Location: Kolkata
|
|
|
|
Hi,
I have two confusions.
1.
When we mention keylen in the PCB we just mention the key length of the field on which the database segments are kept in sorted order..but how it understands what is that key field for the database(whats the position of the bytes) or is it refer the first bytes of root segment?
2.
My another confusion is when we access a second occurrence of a twin we first reach to the first occurrence with the PCB and SSA where we mentioned the segment names and then using the same PCB but different I/O area we use GN call to access the second occurrence.
but if there is no second occurrence will it fetch the next segment though in the provided PCB the segment name(logical view) not given or it will be status code GB.
Please advise. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
The key length is defined in the DBD - you need to look at that. You can acess segments in "key sequence" online. But be very careful HDAM is best for online - quicker and more efficient. But, if you are expecting a report in key sequence, you will need to sort it before output. HIDAM has a little more overhead, but it is always in key sequence.
I don't understand your number 2 question. If you qualify your root segment ssa, and then do an unqualifed ssa for the child segment, you will always begin at the first child segment unless you qualify that ssa. If you use an un-qualified ssa for a specific child segment, you will get either a GE (not found) or a GB (end of database). If you do not use an ssa specfic for that child (no ssa) you will get whatever segment comes next.
So, it would be very helpful if you qualify your problem - and the business requirement. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
IMS works: Down the hierarchy and then left to right. If you qualify your root segment SSA, and then do an unqualifed SSA for the child segment, you will always begin at the first child segment (left most position) unless you qualify that SSA as Sandy has said. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
The pcb-mask contains database name (8 characters), segment level number (2 characters), status code (2 characters), processing options (4 characters), 4 characters reserved space (binary), segment name (8 characters), length of key feedback area (4 characters binary), number of sensitive segments (4 characters binary), and a variable length key feedback area.
Alrighty then......I was just thinking about your question and wanted to clarify something. The key feedback area in your PCB will always hold the keys to the last successful call - up the parent chain. You do not always need to get the parent first. Let's say we have a database with student as the root - a child segment would be classes. We want to know who is taking chemistry. So, we set up our classes SSA as unqualified - no root segment ssa. Once we find a chemistry segment, we look at the keyfeedback area in the PCB. It will contain the root segment key. You can then issue a GU for that student if you want. I would maintain my position by using a second PCB for any GU calls, but you could always reposition yourself. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Oh - let me just say again - you will always be positioned at your last successful call. If you get a GE or GB, you will still be postioned at your last successful call. |
|
Back to top |
|
|
|