All,
Currently the report searches several fields for the customer name aside from the basic 'name' field. This includes the 4 Dun and Bradstreet name assigend to each customer and the 2 additional name fields assigend to each customer for longer customer names. This can make the report quite long to use the .length search. As an example, here is what I created for searching only 2 of the 7 name fields. The example of a company named Chair is simple but imagine any company name. Users do not type anything consistently which is the reason for this search report. We pull this from SAP and SAP is case sensitive.
TABLE FILE ZCUSMAST
PRINT
TABLENAMECUSTNMBR
TABLENAMECUSTNAME1
TABLENAMECUSTNAME2
TABLENAMESTREET
TABLENAMECITY
WHERE TABLENAMECUSTNAME1 CONTAINS '&CSTNAME'
OR TABLENAMECUSTNAME2 CONTAINS '&CSTNAME';
ON TABLE HOLD AS CSTZCN01
END
-IF &CSTNAME.LENGTH EQ 3 GOTO NEXT03;
-IF &CSTNAME.LENGTH EQ 4 GOTO NEXT04;
-IF &CSTNAME.LENGTH EQ 5 GOTO NEXT05;
-IF &CSTNAME.LENGTH EQ 6 GOTO NEXT06;
-IF &CSTNAME.LENGTH EQ 7 GOTO NEXT07;
-IF &CSTNAME.LENGTH EQ 8 GOTO NEXT08;
-IF &CSTNAME.LENGTH EQ 9 GOTO NEXT09;
-IF &CSTNAME.LENGTH EQ 10 GOTO NEXT10;
-IF &CSTNAME.LENGTH EQ 11 GOTO NEXT11;
-IF &CSTNAME.LENGTH EQ 12 GOTO NEXT12;
-IF &CSTNAME.LENGTH EQ 13 GOTO NEXT13;
-IF &CSTNAME.LENGTH EQ 14 GOTO NEXT14;
-IF &CSTNAME.LENGTH EQ 15 GOTO NEXT15;
-IF &CSTNAME.LENGTH EQ 16 GOTO NEXT16;
-IF &CSTNAME.LENGTH EQ 17 GOTO NEXT17;
-IF &CSTNAME.LENGTH EQ 18 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 19 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 20 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 21 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 22 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 23 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 24 GOTO NEXT18;
-IF &CSTNAME.LENGTH EQ 25 GOTO NEXT18;
-NEXT03
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A3');
-GOTO NEXT20;
-NEXT04
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A4');
-GOTO NEXT20;
-NEXT05
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A5');
-GOTO NEXT20;
-NEXT06
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A6');
-GOTO NEXT20;
-NEXT07
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A7');
-GOTO NEXT20;
-NEXT08
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A8');
-GOTO NEXT20;
-NEXT09
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A9');
-GOTO NEXT20;
-NEXT10
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A10');
-GOTO NEXT20;
-NEXT11
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A11');
-GOTO NEXT20;
-NEXT12
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A12');
-GOTO NEXT20;
-NEXT13
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A13');
-GOTO NEXT20;
-NEXT14
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A14');
-GOTO NEXT20;
-NEXT15
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A15');
-GOTO NEXT20;
-NEXT16
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A16');
-GOTO NEXT20;
-NEXT17
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A17');
-GOTO NEXT20;
-NEXT18
-SET &CSTNAME = UPCASE(&CSTNAME.LENGTH, &CSTNAME, 'A18');
-GOTO NEXT20;
-NEXT20
TABLE FILE ZCUSMAST
PRINT
TABLENAMECUSTNMBR
TABLENAMECUSTNAME1
TABLENAMECUSTNAME2
TABLENAMESTREET
TABLENAMECITY
WHERE TABLENAMECUSTNAME1 CONTAINS '&CSTNAME'
OR TABLENAMECUSTNAME2 CONTAINS '&CSTNAME';
ON TABLE HOLD AS CSTZCN02
END
-IF &CSTNAME.LENGTH EQ 3 GOTO NEXT23;
-IF &CSTNAME.LENGTH EQ 4 GOTO NEXT24;
-IF &CSTNAME.LENGTH EQ 5 GOTO NEXT25;
-IF &CSTNAME.LENGTH EQ 6 GOTO NEXT26;
-IF &CSTNAME.LENGTH EQ 7 GOTO NEXT27;
-IF &CSTNAME.LENGTH EQ 8 GOTO NEXT28;
-IF &CSTNAME.LENGTH EQ 9 GOTO NEXT29;
-IF &CSTNAME.LENGTH EQ 10 GOTO NEXT30;
-IF &CSTNAME.LENGTH EQ 11 GOTO NEXT31;
-IF &CSTNAME.LENGTH EQ 12 GOTO NEXT32;
-IF &CSTNAME.LENGTH EQ 13 GOTO NEXT33;
-IF &CSTNAME.LENGTH EQ 14 GOTO NEXT34;
-IF &CSTNAME.LENGTH EQ 15 GOTO NEXT35;
-IF &CSTNAME.LENGTH EQ 16 GOTO NEXT36;
-IF &CSTNAME.LENGTH EQ 17 GOTO NEXT37;
-IF &CSTNAME.LENGTH EQ 18 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 19 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 20 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 21 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 22 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 23 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 24 GOTO NEXT38;
-IF &CSTNAME.LENGTH EQ 25 GOTO NEXT38;
-NEXT23
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A3');
-GOTO NEXT40;
-NEXT24
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A4');
-GOTO NEXT40;
-NEXT25
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A5');
-GOTO NEXT40;
-NEXT26
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A6');
-GOTO NEXT40;
-NEXT27
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A7');
-GOTO NEXT40;
-NEXT28
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A8');
-GOTO NEXT40;
-NEXT29
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A9');
-GOTO NEXT40;
-NEXT30
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A10');
-GOTO NEXT40;
-NEXT31
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A11');
-GOTO NEXT40;
-NEXT32
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A12');
-GOTO NEXT40;
-NEXT33
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A13');
-GOTO NEXT40;
-NEXT34
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A14');
-GOTO NEXT40;
-NEXT35
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A15');
-GOTO NEXT40;
-NEXT36
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A16');
-GOTO NEXT40;
-NEXT37
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A17');
-GOTO NEXT40;
-NEXT38
-SET &CSTNAME = LOCASE(&CSTNAME.LENGTH, &CSTNAME, 'A18');
-GOTO NEXT40;
-NEXT40
TABLE FILE ZCUSMAST
PRINT
TABLENAMECUSTNMBR
TABLENAMECUSTNAME1
TABLENAMECUSTNAME2
TABLENAMESTREET
TABLENAMECITY
WHERE TABLENAMECUSTNAME1 CONTAINS '&CSTNAME'
OR TABLENAMECUSTNAME2 CONTAINS '&CSTNAME';
ON TABLE HOLD AS CSTZCN03
END
-************
-IF &CSTNAME.LENGTH EQ 3 GOTO NEXT53;
-IF &CSTNAME.LENGTH EQ 4 GOTO NEXT54;
-IF &CSTNAME.LENGTH EQ 5 GOTO NEXT55;
-IF &CSTNAME.LENGTH EQ 6 GOTO NEXT56;
-IF &CSTNAME.LENGTH EQ 7 GOTO NEXT57;
-IF &CSTNAME.LENGTH EQ 8 GOTO NEXT58;
-IF &CSTNAME.LENGTH EQ 9 GOTO NEXT59;
-IF &CSTNAME.LENGTH EQ 10 GOTO NEXT60;
-IF &CSTNAME.LENGTH EQ 11 GOTO NEXT61;
-IF &CSTNAME.LENGTH EQ 12 GOTO NEXT62;
-IF &CSTNAME.LENGTH EQ 13 GOTO NEXT63;
-IF &CSTNAME.LENGTH EQ 14 GOTO NEXT64;
-IF &CSTNAME.LENGTH EQ 15 GOTO NEXT65;
-IF &CSTNAME.LENGTH EQ 16 GOTO NEXT66;
-IF &CSTNAME.LENGTH EQ 17 GOTO NEXT67;
-IF &CSTNAME.LENGTH EQ 18 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 19 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 20 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 21 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 22 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 23 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 24 GOTO NEXT68;
-IF &CSTNAME.LENGTH EQ 25 GOTO NEXT68;
-NEXT53
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A3');
-GOTO NEXT70;
-NEXT54
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A4');
-GOTO NEXT70;
-NEXT55
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A5');
-GOTO NEXT70;
-NEXT56
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A6');
-GOTO NEXT70;
-NEXT57
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A7');
-GOTO NEXT70;
-NEXT58
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A8');
-GOTO NEXT70;
-NEXT59
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A9');
-GOTO NEXT70;
-NEXT60
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A10');
-GOTO NEXT70;
-NEXT61
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A11');
-GOTO NEXT70;
-NEXT62
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A12');
-GOTO NEXT70;
-NEXT63
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A13');
-GOTO NEXT70;
-NEXT64
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A14');
-GOTO NEXT70;
-NEXT65
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A15');
-GOTO NEXT70;
-NEXT66
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A16');
-GOTO NEXT70;
-NEXT67
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A17');
-GOTO NEXT70;
-NEXT68
-SET &CSTNAME = LCWORD(&CSTNAME.LENGTH, &CSTNAME, 'A18');
-GOTO NEXT70;
-NEXT70
TABLE FILE ZCUSMAST
PRINT
TABLENAMECUSTNMBR
TABLENAMECUSTNAME1
TABLENAMECUSTNAME2
TABLENAMESTREET
TABLENAMECITY
WHERE TABLENAMECUSTNAME1 CONTAINS '&CSTNAME'
OR TABLENAMECUSTNAME2 CONTAINS '&CSTNAME';
ON TABLE HOLD AS CSTZCN04
END
MATCH FILE CSTZCN01
PRINT TABLENAMESTREET AS 'JUNK1'
BY TABLENAMECUSTNMBR
BY TABLENAMECUSTNAME1
BY TABLENAMECUSTNAME2
BY TABLENAMESTREET
BY TABLENAMECITY
RUN
FILE CSTZCN02
PRINT TABLENAMESTREET AS 'JUNK1'
BY TABLENAMECUSTNMBR
BY TABLENAMECUSTNAME1
BY TABLENAMECUSTNAME2
BY TABLENAMESTREET
BY TABLENAMECITY
RUN
FILE CSTZCN03
PRINT TABLENAMESTREET AS 'JUNK1'
BY TABLENAMECUSTNMBR
BY TABLENAMECUSTNAME1
BY TABLENAMECUSTNAME2
BY TABLENAMESTREET
BY TABLENAMECITY
RUN
FILE CSTZCN04
PRINT TABLENAMESTREET AS 'JUNK1'
BY TABLENAMECUSTNMBR
BY TABLENAMECUSTNAME1
BY TABLENAMECUSTNAME2
BY TABLENAMESTREET
BY TABLENAMECITY
AFTER MATCH HOLD AS CSTZCN05 OLD-OR-NEW
END
TABLE FILE CSTZCN05
SUM JUNK1
PRINT TABLENAMESTREET AS 'JUNK1'
BY TABLENAMECUSTNMBR
BY TABLENAMECUSTNAME1
BY TABLENAMECUSTNAME2
BY TABLENAMESTREET
BY TABLENAMECITY
ON TABLE HOLD AS CSTZCN06
END
TABLE FILE CSTZCN06
PRINT
TABLENAMECUSTNAME1
TABLENAMECUSTNAME2
TABLENAMESTREET
TABLENAMECITY
BY TABLENAMECUSTNMBR
ON TABLE HOLD AS CSTZCN07
END
Thank you,
Geri
Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster