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
 
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am

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