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
 

 

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: 2502
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm


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