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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Way to use eztrieve to search for the '?' character
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: 2360
Location: Israel

PostPosted: Tue Oct 17, 2006 1:58 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Oct 17, 2006 2:02 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Continuation Character ballaswaroop SYNCSORT 8 Thu Aug 25, 2016 4:46 pm
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am


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