Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to access common fields in 2 tables (arrays)??

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

New User


Joined: 21 Dec 2005
Posts: 7

PostPosted: Mon Jan 23, 2006 9:41 am    Post subject: how to access common fields in 2 tables (arrays)??
Reply with quote

hi ,

a small doubt regarding tables.......

suppose i have a field say 'name' defined in two tables as follows,

01 table-1 occurs 10 times
indexed by loc-idx.

05 name pic x(4).

02 table-2 occurs 10 times
indexed by loc-idx.

05 name pic x(4).


Now if i want to access 'name' variable in table-2 , how do i do it???

( i am using two includables which were having same names defined as above and both includables are compulsory )
Back to top
View user's profile Send private message

KMK

New User


Joined: 29 Jul 2005
Posts: 18

PostPosted: Mon Jan 23, 2006 11:50 am    Post subject:
Reply with quote

Hi I guess,

name of table-1 and name of table-2 works .
Back to top
View user's profile Send private message
vikasc4

New User


Joined: 11 Dec 2005
Posts: 32

PostPosted: Mon Jan 23, 2006 12:06 pm    Post subject:
Reply with quote

Hi,

KMK is right. This is called qualification of data item . If two variables under different group item have same name then we can use it.

Exanmple..

Move A to B of Group-1.


I think this will help, if wants more then tell me..

Regards
Vikas
Back to top
View user's profile Send private message
sreenatha

New User


Joined: 21 Dec 2005
Posts: 7

PostPosted: Mon Jan 23, 2006 12:41 pm    Post subject:
Reply with quote

hi KMK,

how can i access seconf field in the array of table-1....

name ( index-name ) of table-1 ??

but in this case , the index-name is also not unique !!!
Back to top
View user's profile Send private message
prabs2006

Active User


Joined: 12 Jan 2006
Posts: 103

PostPosted: Mon Jan 23, 2006 4:46 pm    Post subject:
Reply with quote

Hi,

The same index for two arrays certainly is wrong.This will give an error.
But am not sure abt the "name" field. If at all it is right , the only way it can be accessed by Tab1.name() and Tab2.name().

Please correct me if am wrong

Thanks & Regards
Prabs
Back to top
View user's profile Send private message
KMK

New User


Joined: 29 Jul 2005
Posts: 18

PostPosted: Tue Jan 24, 2006 3:11 pm    Post subject:
Reply with quote

Hi ,

The index name should be uniquely defined. It cannot be qualified.

But Name data field can be qualified as
Name of Table-1 (subscript)
Name of Table-2 (subscript)

Cheers
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
This topic is locked: you cannot edit posts or make replies. Limit access to certain RACF group cvnlynn CLIST & REXX 5 Wed Aug 23, 2017 2:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us