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

Identify whether Particular string is part of another string


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vaishnavi Srivijaya

New User


Joined: 31 Oct 2007
Posts: 11
Location: Bangalore - India

PostPosted: Tue Feb 05, 2008 2:00 pm
Reply with quote

Hi,
My requirement is as below. I have to search for a particular String S1 whether it is part (ie.., Substring) of another string S2.

The basic verb INSPECT can be used with TALLYING Option to identify whether S1 is part of S2. But the Length of S1 is not pre-defined. Only the Maximum Length is known to me & S1 can have any number of characters incluing Spaces.

Is there any Cobol Verb that can be used for above requirement?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Feb 05, 2008 2:25 pm
Reply with quote

determine what length (how many bytes of S1) you are looking for and then use that length as the length of a Reference Modification for S1 in the INSPECT command.

Only you know the definition of the S1 possibilities, so before you ask for a method to determine the length of the portion of S1 to use, tell me more, tell me more!
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts How to identify the transaction categ... IMS DB/DC 3
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top