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
 

 

Hi give me the example for index-displacement in no of bytes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
apsar.kogatam
Warnings : 1

New User


Joined: 27 Jun 2008
Posts: 33
Location: CHENNAI

PostPosted: Mon Jun 30, 2008 3:00 pm    Post subject: Hi give me the example for index-displacement in no of bytes
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Mon Jun 30, 2008 8:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Tue Jul 01, 2008 8:29 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 02, 2008 5:00 am    Post subject: Re: Hi give me the example for index-displacement in no of b
Reply with quote

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
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Wed Jul 02, 2008 12:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Jul 02, 2008 9:12 pm    Post subject:
Reply with quote

Hello,

At the top of the page, there is a link called "IBM Manuals". The following is from the Enterprise COBOL Programming Guide (there are multiple linked and your version should be) linked there:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3pg20/2.6.3.7.8

This is more complete info on the memory mapping of the TGT.

Much other info is in the Programming Guide as well.
Back to top
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Thu Jul 03, 2008 6:53 pm    Post subject:
Reply with quote

This helps a lot. Thanks Dick.
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 Jul 03, 2008 9:49 pm    Post subject: Reply to: Hi give me the example for index-displacement in n
Reply with quote

You're welcome - good luck icon_smile.gif

d
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm
No new posts VSAM Alternate Index in CICS jacobdng CICS 2 Fri May 06, 2016 1:41 pm
No new posts Rebuilding IMS secondary index withou... Hooman24 IMS DB/DC 6 Tue Mar 29, 2016 12:22 pm


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