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

do we need to initialize Index variable in Search command.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Thu Jan 24, 2008 3:29 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
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 Routing command Address SDSF to other... TSO/ISPF 2
Search our Forums:

Back to Top