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
 

 

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 How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am


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