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 DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


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