AS400 Mid Range/querry regarding CL/400
Expert: Concise Systems/Laird Scranton - 9/15/2010
QuestionDear Sir.
Please explain about opnqryf and how to use it in CL400 and
other HLL.Also explain about the following querry:-
!!!!OPNQRYF FILE(FILEA) QRYSLT('"' *CAT &CHAR *CAT '" *EQ
FIELDA')!!!!.
Please tell me how to implement above given query.
AnswerThe OPNQRYF (open query file) command is used in a CL program to create a temporary index over a file, with selections and sequencing that you choose, which you can then process using a high-level-language program.
For information about the OPNQRYF command, see:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/cl/opnqryf.htm
The example you sent OPNQRYF FILE(FILEA) QRYSLT('"' *CAT &CHAR *CAT '" *EQ FIELDA')
is meant to be an example of how to use the command, but it is not complete. I'll explain what I can about it anyway:
1. The FILE parameter is used to indicate the name of the file you wish to open.
2 The QRYSLT (Query Select) option can be very simple, or can get to be very complicated. It is used to explain which records you want to select from the file, for example: QRYSLT(DATE *EQ 101510)
There are many other options and rules for using the command - so many that you really should work with an on-site instructor or tutor who can demonstrate and explain the command.
- Laird