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
 

 

How to search multiple strings in a record using cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to search multiple strings in a record using cobol
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

Moderator


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

PostPosted: Thu Jul 25, 2013 11:00 am    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Thu Jul 25, 2013 11:12 am    Post subject: Reply to: How to search multiple strings in a record using c
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

Site Director


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

PostPosted: Thu Jul 25, 2013 9:19 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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