As on Batch Report Server/400 V1.42, full text index information can be extracted from any spool file and placed into the DOCTXT00 full text index table in WebDocs iSeries edition when a new spool file report is checked in to WebDocs.
Once index info has been placed into the WebDocs Full Text Index table, the "Text Search" in WebDocs can be used to search full text index information.
Steps to set up for full text index report capture:
-
Install Batch Report Server V1.42. Library: RJSBCH
-
Make sure WebDocs iSeries Edition is installed. No special version is needed. Library: RJSIMAGE
- Enable full text index searching in WebDocs via the following command:
CHGDTAARA DTAARA(RJSIMAGE/DOCFTEXT) VALUE(*YES)
-
Enable full text index report capture for iSeries reports via the following command:
CHGDTAARA DTAARA(RJSBCH/BCHFULLTXT) VALUE(*YES)
-
Go to the RJSBCH menu (ADDLIBLE RJSBCH, GO RJSBCH) option 6. Edit Report Masks to create full text field extraction masks for each selected report you want to full text index. One or more areas of a report may be searched for key information to be extracted.
Once a mask is created for a report, the next time it gets captured into WebDocs, the full text index process will run against the report to extract key information from the report.
Regular Expression Examples
^ - Pattern starts at beginning of data line.
. - Period stands for any character.
[0-9] - Character must be a number 0-9
[a-z] - Character must be a lower case letter.
[A-Z] - Character must be a upper case letter.
[a-zA-Z] - Character must be a lower or upper case letter.
Testing Regular Expressions Before Using
The BCHREGEXP CL command can be used to test a regular expression string pattern. If the command fails, a CPF9898 message will be issued when this command is called. This command uses the same logic as the full text index extraction process for regular expression pattern matching.
Sample BCHREGEXP Call to Match String if it begins with a number, then has a space and then an a-z or A-Z character in the 3rd position.
BCHREGEXP STRING('1 This is a test') PATTERN('[0-9] [a-zA-Z]') DSPRESULT(*YES)
Mask samples
Extract Manager and Rep Number, Cust Number and Invoice Data from RJS RPTSAMPLE Report
MGR: 001 O U T S T A N D I N G I N V O I C E S
Sales Rep: 100 DATE: 09/30/94 PAGE: 1
INV INVOICE SALES SALES CUST INVOICE
# DATE OFFICE PERSON # COMPANY AMOUNT BALANCE
----- -------- ------- ------ ---- --------------- ---------- ---------
51024 07/21/93 MIAMI RAL 2004 GOLD COAST IND. 15,894.72 9,536.83
51098 08/06/93 CHICAGO SJK 1056 XYZ INDUSTRIES 8,976.73 4,488.73
51128 09/12/93 DALLAS KAL 2564 GOODWIN & CO. 10,467.98 2,616.75
51215 11/03/93 CHICAGO RCH 1277 ROBINSON BROS. 934.12 934.12
51556 12/28/93 CHICAGO SJK 1983 TWELVE OAK INC. 98.50 98.50
51623 01/04/94 DALLAS MBE 3609 ACME IND. 1,522.34 506.94
51789 01/09/94 LOS ANG ABA 1059 H. H. WEBSTER 23,655.00 23,655.00
52031 02/19/94 CHICAGO SJK 1056 XYZ INDUSTRIES 2,302.65 802.65
52256 03/16/94 MIAMI RAL 2004 GOLD COAST IND. 18,989.30 9,494.65
52307 03/27/94 CHICAGO PTR 3217 TRI STATE CO. 532.35 9.00
52691 04/22/94 CHICAGO RCH 3185 BROWN & SONS 4,320.45 2,320.45
Spool File: RPTSAMPLE
Seq: 1 (any arbitrary number)
Criteria Pattern: ^MGR:
Pattern Beg Col: 2
Pattern End Col: 5
Field Data Beg Col: 7
Field Data End Col: 9
Spool File: RPTSAMPLE
Seq: 2 (any arbitrary number)
Criteria Pattern: ^Rep:
Pattern Beg Col: 8
Pattern End Col: 11
Field Data Beg Col: 12
Field Data End Col: 15
Spool File: RPTSAMPLE
Seq: 3 (any arbitrary number)
Criteria Pattern: ^[0-9][0-9][0-9][0-9][0-9]
Pattern Beg Col: 2
Pattern End Col: 6
Field Data Beg Col: 2
Field Data End Col: 6
Spool File: RPTSAMPLE
Seq: 4 (any arbitrary number)
Criteria Pattern: ^[0-9][0-9]/[0-9][0-9]/[0-9][0-9]
Pattern Beg Col: 8
Pattern End Col: 15
Field Data Beg Col: 8
Field Data End Col: 15
The first criteria above extracts manager number from the report.
The second criteria above extracts rep number from the report.
The third criteria above extracts customer number from the report.
The fourth criteria above extracts invoice date from the report.
Extract Customer Numbers from Report based on Line Pattern
This sample report has data lines similar to following and user wants to extract customer number from first 6 bytes. Notice that the customer number is zero suppressed, which means no leading zeros show. There is also always a blank space after customer number and before the name.
ACR250 Report Title
123456 Customer Name
Some other data ..................................
4 Customer Name
Some other data ..................................
Some other data ..................................
Some other data ..................................
Some other data ..................................
15 Customer Name
Some other data ..................................
Some other data ..................................
Some other data ..................................
Regular expression mask entry to handle extracting customer numbers from report. All leading and trailing blanks are trimmed automatically during field extraction with Batch Report Server.
Spool File: ACR250
Seq: 1 (any arbitrary number)
Criteria Pattern: ^[0-9] [a-zA-Z]
Pattern Beg Col: 6
Pattern End Col: 8
Field Data Beg Col: 1
Field Data End Col: 6
The criteria pattern above extracts the customer number from positions 1-6 on the data line every time the data extracted from columns 6-8 contains a number in the first position and a space in the 2nd position and any letter in the 3rd position.