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

How to search multiple strings in a record using cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pavankumar.m
Warnings : 1

New User


Joined: 28 Nov 2010
Posts: 53
Location: Mumbai

PostPosted: Thu Jul 25, 2013 7:55 am
Reply with quote

hi,

Can any one please suggest me how to search a mutiple strings in single go in a record.

Ex:my records has below data(in sequential file)

hello how are you, doing good
where are you from ,I am from banglore

Rerquirement:-Need to verify whether the strings 'are' 'from' present in above records. here i need scan each record for these two strings. The string position may change for each record.

Can any one please suggest me best and simply to solve this.

I tried using substring, perform loop but the processing is not efficient, becuase i have around 15 strings to search at a time in each record.

Thanks and Regards,
Pavan Kumar.M
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jul 25, 2013 11:00 am
Reply with quote

You might need to do seperate INSPECT TALLYING for each string record by record

or if the sole purpose of the requirement is to search for strings and copy , you could think of DFSORT unless it is a NOT must do in COBOL only.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 25, 2013 11:12 am
Reply with quote

Can you show what you have tried?

Do you just need to know the sub-strings are "there" or do you need to know where they are, as in start-position?

Are the sub-strings fixed, or "dynamic"?

Why are you concerned about efficiency, is your volume of data large?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 25, 2013 9:19 pm
Reply with quote

Hello,

If your goal is to parse multiple strings (15) from a large data file, be prepared for High resource consumption.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top