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: 1534
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: 7315

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. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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