|
|
| Author |
Message |
apsar.kogatam
New User
Joined: 27 Jun 2008 Posts: 2 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 |
|
 |
References
|
Posted: Mon Jun 30, 2008 3:00 pm Post subject: Re: Hi give me the example for index-displacement in no of bytes |
 |
|
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7518 Location: 221 B Baker St
|
|
|
|
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:
http://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
New User
Joined: 31 Jan 2008 Posts: 18 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
Active User
Joined: 14 Jan 2008 Posts: 270 Location: Orlando, FL, 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
Active User
Joined: 07 Jun 2005 Posts: 60 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
Global Moderator
Joined: 23 Nov 2006 Posts: 7518 Location: 221 B Baker St
|
|
| Back to top |
|
 |
donevin
Active User
Joined: 07 Jun 2005 Posts: 60 Location: South Africa
|
|
|
|
| This helps a lot. Thanks Dick. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7518 Location: 221 B Baker St
|
|
|
|
You're welcome - good luck
d |
|
| Back to top |
|
 |
|
|