You cannot use AND in the JOIN when the cross-referenced file is a FOCUS DB. I would DEFINE or COMPUTE the concatenated fields when creating both HOLD files and then JOIN using the computed/defined field.
(FOC236) LINKED FILE DOES NOT HAVE A MATCHING KEY FIELD OR SEGMENT:
The referencing, and cross-referenced file do not have the field
named as the CRKEY in common. The CRKEY must be the fieldname or
alias of the referencing field and the fieldname of the cross-
referenced field.
From the documentation on JOIN:
Syntax: How to Join Real Fields
The following JOIN syntax requires that the fields you are using to join the files are real fields declared in the Master File. This join may be a simple one based on one field in each file to be joined, or a multi-field join for data sources that support this type of behavior. The following syntax describes the simple and multi-field variations:
JOIN [LEFT_OUTER|INNER] hfld1 [AND hfld2 ...] IN hostfile [TAG tag1]
TO [UNIQUE|MULTIPLE]
crfield [AND crfld2 ...] IN crfile [TAG tag2] [AS joinname]
END
where:
JOIN hfld1
Is the name of a field in the host file containing values shared with a field in the cross-referenced file. This field is called the host field.
AND hfld2...
Can be an additional field in the host file, with the caveats noted below. The phrase beginning with AND is required when specifying multiple fields.
When you are joining two FOCUS data sources you can specify up to four alphanumeric fields in the host file that, if concatenated, contain values shared with the cross-referenced file. You may not specify more than one field in the cross-referenced file when the suffix of the file is FOC. For example, assume the cross-referenced file contains a phone number field with an area code-prefix-exchange format. The host file has an area code field, a prefix field, and an exchange field. You can specify these three fields to join them to the phone number field in the cross-referenced file. The JOIN command treats the three fields as one. Other data sources do not have this restriction on the cross-referenced file.
For data adapters that support multi-field and concatenated joins, you can specify up to 16 fields. See your data adapter documentation for specific information about supported join features. Note that FOCUS data sources do not support these joins.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server