AS400 Mid Range/querry regarding CL/400

Advertisement


Question
Dear 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.

Answer
The 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

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.