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

Perform search condition on two table with same column name


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Sat Aug 27, 2005 1:59 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top