× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Doc-
I have written some code to find strings in source code,
front-ended with a command to allow you to specify
multiple search strings.

It prints two listings:
- a list of members where the strings were found,
- a list of the source statements where the strings were found.

Here is what the command looks like when prompted:

---------------------------------------------------------------------
                                   Find String (FNDSTR)

  Type choices, press Enter.

  Search strings . . . . . . . . .  STRING
                            + for more values
  Source file name:  . . . . . . .  SRCFILE          JDESRC*
    Library name:  . . . . . . . .                     *USRLIBL
  Source member name:  . . . . . .  SRCMBR           *ALL
  Omit Library:  . . . . . . . . .  OMITLIB          *NONE
  Show Commented lines?  . . . . .  COMMENT          *NO
  Mark Records?  . . . . . . . . .  MARK             *NO
  Columns to search:                COL
    From column  . . . . . . . . .                   1
    To column  . . . . . . . . . .                   *RCDLEN
  Submit job?  . . . . . . . . . .  SUBMIT           *YES

---------------------------------------------------------------------

I'm willing to sharing my code, if you're interested in having a copy.

Regards,
Steve Landess
Austin, Texas
(512) 423-0935

----- Original Message ----- 
From: "EDoxtator" <>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, August 04, 2004 11:40 AM
Subject: Alternatives to LIKE in SQL


> Hey All
>
> I'm going to be doing some mass-scans of RPGLE source, and I'm trying to
figure
> out if there's a better way than using the SQL LIKE keyword.
>
> I was thinking I'd to do Dynamic SQL that looks something like this:
>
>
> SELECT COUNT(*) FROM SRCMBR
>   WHERE SRCDTA LIKE '%<field name>%' AND
>     SUBSTR(srcdta,7,1) <> '*'
>
> This select does two character comparasons, which can't be cheap, and the
LIKE
> has to do a pattern match which is likewise expensive.  However, I don't
know
> enough about SQL to do anything that would be less intensive.
>
> This is part of a set of programs that will enable me to keep track of
various
> versions of our product at certain customer sites.  For that reason, I
want
> this solution to be as automated as possible (otherwise, I'd wumpus up
some
> quick and dirty programs driven through a PDM option).
>
> Any ideas?
>
> Thanks
>
> -Doc
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.