IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to access common fields in 2 tables (arrays)??


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts How to access web services/website? Mainframe Interview Questions 4
No new posts access the last host command CLIST & REXX 2
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts CICS Access to RACF CICS 2
Search our Forums:

Back to Top