IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Way to use eztrieve to search for the '?' character


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
barobaybay

New User


Joined: 22 Jul 2005
Posts: 12
Location: Philippines

PostPosted: Tue Oct 17, 2006 12:55 pm
Reply with quote

Hi,
I need to know if there is a way to use eztrieve to search for the '?' character in a given field name. i see in an eztrieve manual there is a utility macro STRSRCH, however i do not know how to use it. then, if that invalid character is found, i want to replace that character into a space. Any ideas? thanks and more power! icon_question.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Oct 17, 2006 1:58 pm
Reply with quote

CA provides great documentation of STRSRCH in prefix.EZTRIEVE.SAMPJCL(STRSRDOC).

By the way, this macro is based on the Boyer-Moore algorithm for string search, and you cam read more about it in Wikipedia.

O.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Oct 17, 2006 2:02 pm
Reply with quote

I just noticed that CA allows the ditribution of this macro's documentation, so here it is:
Code:
 STRSRCH Macro

    The STRSRCH macro provides a rapid string search that returns the
    position of the search pattern within the target string, or returns
    a zero if the search pattern does not occur in the target string.

 Syntax
        +-------------------------------------------------------------------+
        |                                                                   |
        |  %STRSRCH pattern pattern-length target target-length position +  |
        |          {MAXPAT integer} {MAXTRG integer}                        |
        |                                                                   |
        +-------------------------------------------------------------------+

 pattern         This alpha field or literal is the value for which to search.

 pattern-length  This numeric field or literal is the length of the pattern for
                 which to search.  It does not necessarily have to specify the
                 entire defined length of the pattern field.  It may be less
                 than that length, and only the specified number of characters
                 will be considered.

 target          This alpha field or literal is the target string that is to be
                 searched.

 target-length   This numeric field or literal is the length of the target
                 string.  As with the pattern-length, it does not necessarily
                 have to specify the entire defined length of the target field.
                 If it is less than that length, only the specified number of
                 characters will be considered.

 position        This numeric field is where the result of the search is
                 returned.  A zero indicates that the pattern was not found in
                 the target string.  Any other value indicates the position in
                 the target string where the first character of the pattern
                 occurs.

 MAXPAT integer  This keyword parameter specifies the maximum possible size in
 (Optional)      characters of the search pattern.  Its default is 64.

 MAXTRG integer  This keyword parameter specifies the maximum possible size in
 (Optional)      characters of the target string.  Its default is 4096.

                 MAXPAT and MAXTRG are used to define storage and need not be
                 changed unless the maximum possible field sizes are greater
                 than the defaults.


 Operation -     STRSRCH generates no output and can be used alone or in
 INLINE          conjunction with other routines and/or EASYTRIEVE PLUS logic.

 Operation -     No changes in the specification of parameters are required to
 Data Base       use STRSRCH with data base files.  For files with variable
                 length records, the EASYTRIEVE PLUS defined field RECORD-LENGTH
                 may be used for the "target-length" parameter, unless  you do
                 not wish to search the entire input record.

1Reference       This macro uses an algorithm developed by Robert S. Boyer and
                 J. Strother Moore and discussed in their article "A Fast String
                 Searching Algorithm" in Communications of the ACM, Volume 20,
+                                        _________________________
                 Number 10 (October, 1977), pages 762-772.  The Boyer-Moore
                 algorithm is further discussed by Richard Wiggins and Paul
                 Wolberg in "Searching for Strings with Boyer-Moore," Computer
+                                                                     ________
                 Language, Volume 3, Number 11 (November, 1986), Pages 28-42.
+                ________

 Copyright       The STRSRCH macro and all documentation were written and are
 Information     copyright (c) 1987 by:

                      J. Russell Jones
                      HCA/Wesley Medical Center
                      550 N. Hillside
                      Wichita, KS  67212

                 and are hereby placed in the public domain and may be used and
                 distributed freely as desired provided that full credit be
                 given to both the author and HCA/Wesley Medical Center in any
                 documenation accompanying such use.

.

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top