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
 

 

Table Handling

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ibmlearner

New User


Joined: 07 May 2007
Posts: 7
Location: Bangalore

PostPosted: Mon Jan 11, 2010 3:28 am    Post subject: Table Handling
Reply with quote

All

I need to Search the Table. Say the Table is like below

P S R

1 2 3
2 3 4
3 4 5
4 5 6


SET IDX TO +1

SEARCH TABLE
AT END GO TO PARA-EXIT
WHEN P(IDX) = 1 AND S(IDX) = 2
MOVE R(IDX) TO SOME-VARIABLE
PARA-EXIT.

How to search the next three elements

Can I code multiple WHEN conditions.Please suggest.sine Index set to +1 it will search the first element.(but Index increment will be taken care by SEARCH) If set the index up by +1 then it will go to next element.but how to code SEARCH
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8119
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jan 11, 2010 3:39 am    Post subject:
Reply with quote

Quote:
Can I code multiple WHEN conditions.Please suggest
There is a link to manuals at the top of this page. I suggest you click on it, find the COBOL Language Reference manual, find the SEARCH section, and find out yourself.

The way you've described it, this sounds like a homework exercise more than a real-world need -- and it sounds like an artificial way to invoke the SEARCH verb, at that. Multiple IF statements would handle what you've said you wanted to do without needing any SEARCH statement.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Jan 11, 2010 9:33 am    Post subject:
Reply with quote

After reading about table handling, if you still have a question, show the exact definition of the table. What you've shown doesn't indicate how many dimensions you have.
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 Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 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 Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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