View previous topic :: View next topic
|
Author |
Message |
apsar.kogatam Warnings : 1 New User
Joined: 27 Jun 2008 Posts: 33 Location: CHENNAI
|
|
|
|
Hi i know the difference between index and subscript in theoritically.
but what is displacement in no of bytes in index?
can u give me the example for me to undersatnd.
Regards,
apsara. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but what is displacement in no of bytes in index?
can u give me the example for me to undersatnd. |
You have probably not received a reply because your question is not yet understood.
Please clarify "displacement" in your question. What sort of example will help you?
There is a link at the top of the page named "IBM Manuals". The following is from a COBOL manual linked there:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3pg20/8.1.3
It is what you are looking for. If you fnd something that is not clear, post what you found and your question(s) about it. Somone will be able to explain. |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Diaplacemrent is nothing but the number of bytes it traversed to reach that value
For example you have declared a table as:
Code: |
01 tab ,
02 v1 pic 99 occurs 10 times indexed by i1. |
If you try to access v1(2) means , internally the displacement will be 4 bytes as each will allocate 2 bytes.But it doesn't matter how internally it will takes just using indexed is more efficient and no need to declare the variable |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
FWIW, an INDEX is an aligned binary-fullword stored in the TGT (Task Global Table of the given program) and used by the program when array/table addressing is needed.
It is the best method for addressing data in an array and is a REQUIREMENT if the array is defined with a KEY in ASCENDING or DESCENDING order (for use with a SEARCH ALL).
Bill |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
Hi Bill
Where can I get hold of documentation that explains these kind of neat stuff like TGT's and so on? I have been a COBOL programmer for some time and would like to take my skills to the next level but have difficulty in finding the applicable information. Thanks in advance for your reply. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
This helps a lot. Thanks Dick. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
|