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
 

 

do we need to initialize Index variable in Search command.

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

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Thu Jan 24, 2008 2:50 pm    Post subject: do we need to initialize Index variable in Search command.
Reply with quote

While using Search, if array uses Indexed by keyword, then do we need to set the Index value to 1. Or by default it will take it as 1.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jan 24, 2008 3:29 pm    Post subject:
Reply with quote

SEARCH is a command which is executed against an internal cobol table. array is a term used in other programming languages.

If you would spend 10 seconds looking at the search syntax you would have your answer.

Quote:

___ Format 1--serial search ____________________________________________
| |
| >>__SEARCH__identifier-1__ ___________________________ ______________> |
| |_VARYING__ _identifier-2_ _| |
| |_index-name-1_| |
| |
| >__ _____________________________________ ___________________________> |
| |_ ____ __END__imperative-statement-1_| |
| |_AT_| |
| |
| <_______________________________________________ |
| >____WHEN__condition-1__ _imperative-statement-2_ _|_________________> |
| |_NEXT-SENTENCE__________| |
| |
| >__ ____________ ___________________________________________________>< |
| |_END-SEARCH_| |
| |
|________________________________________________________________________|



Quote:

___ Format 2--binary search ______________________________________________________________________
| |
| >>__SEARCH ALL__identifier-1__ _____________________________________ __________________________> |
| |_ ____ __END__imperative-statement-1_| |
| |_AT_| |
| |
| >__WHEN__ _data-name-1__ ____ __ _EQUAL__ ____ _ __ _identifier-3____________ _ _______________> |
| | |_IS_| | |_TO_| | |_literal-1_______________| | |
| | |_=_____________| |_arithmetic-expression-1_| | |
| |_condition-name-1____________________________________________________| |
| |
| <__________________________________________________________________________________ |
| >____ ______________________________________________________________________________ _|________> |
| |_AND__ _data-name-2__ ____ __ _EQUAL__ ____ _ __ _identifier-4____________ _ _| |
| | |_IS_| | |_TO_| | |_literal-2_______________| | |
| | |_=_____________| |_arithmetic-expression-2_| | |
| |_condition-name-2____________________________________________________| |
| |
| >__ _imperative-statement-2_ __ ____________ _________________________________________________>< |
| |_NEXT SENTENCE__________| |_END-SEARCH_| |
| |
|__________________________________________________________________________________________________|

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 SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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