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
 

 

Perform search condition on two table with same column name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Mon Aug 22, 2005 3:20 pm    Post subject: Perform search condition on two table with same column name
Reply with quote

i have declared two tables and both tables have same column name.
I need to perform search condition on both the table.

Code:
ex: 01 taba
          02 taba- rec occurs 5 times index by a.
              05   x       pic    99
              05   y       pic    99

01 tabb
          02 tabb- rec occurs 5 times index by b.
              05   x       pic    99
              05   y       pic    99


Now i want search both the tables.

when
Code:
search taba-rec
   when x(a)='dd'
end-search
search tabb-rec
   when x(b)='cc'
end-search



Is above code cause any problem.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Sat Aug 27, 2005 1:59 pm    Post subject: Re: Search
Reply with quote

Hi learnmf,

First thing I doubt whether you can define X & Y like this under both TABA & TABB. Also there are some Systactical corrections to be.
also X & Y defined numeric having values DD & CC...Can they ?

What you are exactly looking for...Better you write your whole code...

Quote:
Is above code cause any problem.

The best answer to this question will to execute the code, & you'll come to know whether it causes any problem or not.

Regards,

Priyesh.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Aug 27, 2005 10:19 pm    Post subject:
Reply with quote

Hi learnmf,

I think you use:

when x(a) of taba = 'dd'
when x(b) of tabb = 'cc'
etc.

You must qualify each duplicate dataname w/the table name in each reference.

Check the COB ref manual for the precise syntax. The manuals at this site are organized nicely for easy reference.

P.S. You have the option of using "in" instead of "of".
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


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