Summary
................................................................................................................................ 24
Appendix A: OPNQRYF command parameters and SQL equivalents
................................ 25
File specifications (FILE) ..................................................................................................................... 25
Open options (OPTIONS) ................................................................................................................... 27
Format specifications (FORMAT) ........................................................................................................ 27
Query selection expression (QRYSLT) ............................................................................................... 28
Key-field specifications and ordering (KFLD) ....................................................................................... 28
Unique key fields (UNIQUEKEY) ......................................................................................................... 29
Join field specifications (JFLD) ............................................................................................................ 29
Join file order (JORDER) ..................................................................................................................... 30
Join file order (JDFTVAL) .................................................................................................................... 30
Grouping field names (GRPFLD) ........................................................................................................ 31
Group-selection expression (GRPSLT) ............................................................................................... 31
Mapped-field specifications (MAPFLD) ............................................................................................... 32
Ignore decimal-data errors (IGNDECERR) ......................................................................................... 33
Open-file identifier (OPNID) ................................................................................................................. 33
Limit to sequential only (SEQONLY) ................................................................................................... 34
Commitment control active (COMMIT) ................................................................................................ 34
Open scope (OPNSCOPE) ................................................................................................................. 34
Duplicate key check (DUPKEYCHK) ................................................................................................... 35
Allow copy of data (ALWCPYDTA) ...................................................................................................... 35
Performance optimization (OPTIMIZE) ................................................................................................ 35
Optimize all access paths (OPTALLAP) .............................................................................................. 35
Sort sequence (SRTSEQ) ................................................................................................................... 36
Language ID (LANID) .......................................................................................................................... 36
Final-output CCSID (CCSID) ............................................................................................................... 36
Type of open (TYPE) ........................................................................................................................... 36
Appendix B: OPNQRYF functions and SQL equivalents
..................................................... 37
Appendix C: Conversion examples and performance measurements
............................... 39
Dynamic record selection .................................................................................................................... 40
Dynamic ordering ................................................................................................................................ 41
Grouping .............................................................................................................................................. 41
Dynamic joining ................................................................................................................................... 41
Unique-key processing ........................................................................................................................ 42
Final total-only processing ................................................................................................................... 42
Random access of result set ............................................................................................................... 42
Appendix D: Resources
........................................................................................................ 45
Appendix E: About the author
.............................................................................................. 46
Acknowledgements ............................................................................................................................. 46
Trademarks and special notices
........................................................................................... 47
Moving from OPNQRYF to SQL