Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 TBSARG - Deleting the search criteria... ISPFHerc TSO/ISPF 6 Thu Dec 14, 2017 8:18 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us