|
CALL QCLSCAN 1.25 Scan for String Pattern (QCLSCAN) API +------------------------------------------------------------------------+ ¦ ¦ ¦ Required Parameter Group: ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ +--------------------------------------------------------------------+ ¦ ¦ ¦ 1 ¦ Character string ¦ Input ¦ Char(*) ¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 2 ¦ Length of character string ¦ Input ¦ Packed(3,0¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 3 ¦ Starting position ¦ Input ¦ Packed(3,0¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 4 ¦ Character pattern ¦ Input ¦ CHAR(*) ¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 5 ¦ Length of character pattern ¦ Input ¦ Packed(3,0¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 6 ¦ Translate characters ¦ Input ¦ CHAR(1) ¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 7 ¦ Trim trailing blanks ¦ Input ¦ CHAR(1) ¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 8 ¦ Wildcard character ¦ Input ¦ CHAR(1) ¦ ¦ ¦ +----+------------------------------------------+--------+-----------¦ ¦ ¦ ¦ 9 ¦ Character string result ¦ Output ¦ Packed(3,0¦ ¦ ¦ +--------------------------------------------------------------------+ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ Threadsafe: No ¦ ¦ ¦ +------------------------------------------------------------------------+ The Scan for String Pattern (QCLSCAN) API is used to scan a string of characters to see if the string contains a pattern. This function is similar to the scan function supported within source entry utility (SEU) and on the display presented by the Display Spooled File (DSPSPLF) command. In addition, the QCLSCAN API also allows you to specify a 1-byte character in the pattern that matches with any character in the string to be searched, and a start position, which allows you to search the same string more than once. A typical use of the QCLSCAN API is to allow the work station user to retrieve all records that contain a specified pattern. For example, if the database has records with book titles, the work station user may want to retrieve all those books with the pattern CHICAGO in the title. The work station user enters CHICAGO on the device display. The application program reads the database, calling the QCLSCAN API at least once for each record to test for the pattern. The application program only processes the records that pass the test for the pattern CHICAGO. Another alternative for this task is using the Open Query File (OPNQRYF) command. If you are searching an entire database member, the OPNQRYF command normally produces faster results. If you are searching a small subset of a member or the file is already open, QCLSCAN normally produces faster results. Scanning a field can require many lines of code in a high-level language and can cause a significant amount of overhead. Calling the QCLSCAN API and passing it a parameter list may be a simpler and faster way to do the scan. -----Original Message----- From: mgross@gbc.com [mailto:mgross@gbc.com] Sent: Tuesday, December 28, 1999 8:35 AM To: RPG400-L@midrange.com Subject: Scanning String Have a need to scan a string in CL program. Recall there's an API to do this, but can't remember. Would anyone know the name and/or have an example? TIA-- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.