Grouping with a shared-weight sort sequence table (SRTSEQ(*LANGIDSHR) LANGID(ENU)).
SELECT JOB FROM STAFF GROUP BY JOB
When using the OPNQRYF command, specify:
OPNQRYF FILE((STAFF)) FORMAT(FORMAT2) GRPFLD((JOB)) SRTSEQ(*LANGIDSHR) LANGID(ENU)
The system can only use index SHRIX.
The following examples assume that 3 more indexes are created over columns JOB and SALARY. The CREATE INDEX statements precede the examples.
Assume an index HEXIX2 was created with *HEX as the sort sequence.
CREATE INDEX HEXIX2 ON STAFF (JOB, SALARY)
CREATE INDEX UNQIX2 ON STAFF (JOB, SALARY)
Assume an index SHRIX2 was created with a shared-weight sort sequence.
CREATE INDEX SHRIX2 ON STAFF (JOB, SALARY)