Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1542
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
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us