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
 
Command to serach a String

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Sowmya Ramachandra

New User


Joined: 11 May 2007
Posts: 20
Location: Canada

PostPosted: Wed Feb 18, 2009 4:05 am    Post subject: Command to serach a String
Reply with quote

Hi,

I have a an group varible which is as indicated below.
01 DESCRIPTION
05 DESCR1 OCCURS 4 TIMES PIC X(30).

I need to search for a string in the above feild and pick the next 10 bytes from the position. In order to this I thought of using the Inspect command. But this check will happen for each and every record present in the Database I feel this will impact the performance. Can anyone suggest me if there is any alternative ?

Is the Search comman better option. Please Advice.
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: Wed Feb 18, 2009 4:36 am    Post subject:
Reply with quote

Hello,

Text searching by nature requires large amounts of cpu.

I suspect that SEARCH will not do what you want. . .

Can the string "overlap" descr1 entries or will the string completely be within an individual entry?

You could write your own code using reference modification, but INSPECT will probably use less cpu.
Back to top
View user's profile Send private message
Sowmya Ramachandra

New User


Joined: 11 May 2007
Posts: 20
Location: Canada

PostPosted: Wed Feb 18, 2009 6:38 am    Post subject:
Reply with quote

It is will be in any one of these occurences of Descr1. If you provide some example it will be helpful ...
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 18, 2009 7:02 am    Post subject: Reply to: Command to serach a String
Reply with quote

Regardless as to the method used to search for a particular value in each occurrence of the 30-Byte DESCR1 field, if the last byte of the value found ends in position 21 or less, then extracting the next 10-Bytes will work. Otherwise, this would be an error.

Regards,
Back to top
View user's profile Send private message
Sowmya Ramachandra

New User


Joined: 11 May 2007
Posts: 20
Location: Canada

PostPosted: Wed Feb 18, 2009 8:08 am    Post subject:
Reply with quote

The string will either occur in the beginning or in the middle of string so we will not have any error by extracting the next 10 bytes. My problem here is to identify the method to be used for searching.
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: Wed Feb 18, 2009 8:21 am    Post subject:
Reply with quote

Hello,

Quote:
In order to this I thought of using the Inspect command.
As you mentioned, INSPECT will do what you need.

Quote:
The string will either occur in the beginning or in the middle of string so we will not have any error by extracting the next 10 bytes.
Suggest you include code to verify there actually are 10 "safe" bytes to move so that there is no surprise a later time.
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 OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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