From IBI Site:
FOCUS for Mainframe Techniques/Code Examples
How to get around the FOC017 error message when using WHERE field in FILE ddname syntax
Applicable to: All releases
As of IBM Mainframe Release 7.0, the previous FOCUS limit of 3,200 bytes in a file used for selection criteria has been changed to 32,767 literals. This change applies to IF tests that use the following syntax:
IF fieldname operator (ddname) [OR (ddname)...]
The limit for the WHERE phrase remains unchanged. See the FOCUS for IBM Mainframe User Manual for more information on IF and WHERE syntax. The old limit of 3,200 bytes still applies to all non-FOCUS databases with the exception of relational tables.
Here are some solutions to consider when using WHERE field in FILE ddname syntax:
If WHERE is being used, try changing the syntax to use the IF syntax as noted above.
If the file you are testing on is a non-FOCUS file, try changing the file to a FOCUS file by HOLDing it, using ON TABLE HOLD FORMAT FOCUS so that you can still use the IF fieldname operator (ddname) syntax. This will allow the maximum limit to be 32K.
If you can put the conditions you need met in a DEFINE, define a numeric field such that it is 1 if the condition is true, 0 if it is false. Then do a multi-verb request such as:
SUM DEFINE_FIELD BY SSN
PRINT whatever BY SSN
WHERE TOTAL DEFINE_FIELD GT 0
This will give you a list of only those SSN's that have any record that meets the DEFINE_FIELD criteria.
Consider the use of JOIN or DECODE as an alternative as documented in the Systems Journal Encyclopedia, Fall 1991.
Example using JOIN:
TABLE FILE ORIGLIS
SUM COMPUTE SELECT/I1=1;
BY ORIGDEPT
ON TABLE HOLD FORMAT FOCUS INDEX ORIGDEPT
END
JOIN DEPARTMENT IN EMPLOYEE TO ORIGDEPT IN HOLD AS JOIN1
TABLE FILE EMPLOYEE
PRINT LAST_NAME FIRST_NAME
IF SELECT NE 0
END
Example using DECODE:
DEFINE FILE EMPLOYEE
SELECT/I1=DECODE DEPARTMENT(DEPTLIST ELSE 1);
END
TABLE FILE EMPLOYEE
PRINT LAST_NAME FIRST_NAME
IF SELECT EQ 0
END
Split the external file into separate files and use multiple IF statements to get around the file limitation.
The Link
Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe