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
 

 

Identify whether Particular string is part of another string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Identify whether Particular string is part of another string
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    Post subject:
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    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 Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


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