This example shows how to optimize for the first set of records.
OVRDBF FILE(FILEA) SHARE(*YES) OPNQRYF FILE(FILEA) QRYSLT('CODE = "B" ') + SEQONLY(*YES 15) OPTIMIZE(*FIRSTIO) CALL PGM(PGMA) CLOF OPNID(FILEA) DLTOVR FILE(FILEA)
The system optimizes handling the query and fills the first buffer with records before completing the entire query regardless of whether an access path already exists over the Code field.