Use IDMS mode SQL (SET ACCESS IDMS) instead of OLQ mode (SET ACCESS OLQ).
This can be done in OLQ but it means that the SQL statement will be executed via the CA IDMS SQL Option. This is a much more robust engine which has no such restriction.
Using IDMS mode SQL will require the following:-
1. The dictionary in use has a catalog component.
2. There is an SQL schema defined for the non-SQL schema and database in use.
3. Record names containing a hyphen ("-") will need to be double quoted, e.g "DENTAL-CLAIM" as opposed to DENTAL-CLAIM.
4. Record names will need to be qualified with the SQL schema name (if not otherwise set at profile level), e.g. EMPNET."DENTAL-CLAIM".
5. Hyphens ("-") in element names will need to be replaced with underscores ("_"), e.g. EMP_ID_0415 as opposed to EMP-ID-0415.