View Full Version : Query Devlopment
Guest.Visitor
01-01-1995, 02:00 AM
I am writing a AS/400 query that will prompt the user to enter in the value then run the query with that value as the Select value. I am having to do this without any manuals or any documentation. I would appreciate any help on this subject.
Guest.Visitor
06-14-2000, 07:25 AM
One suggestion: IBM has all the AS/400 manuals available on the Internet. Try this URL: http://publib.boulder.ibm.com. It's a gold mine. I do what you're trying to do all the time. I know that the there are other ways of doing this using the newer (to me) query management functions, but I developed this in the "old days" and it works really well, so I just keep cloning it. I'm sure someone else will tell you how to accomplish this in another way, but here's what I do: I always define a command to prompt the user for the selection criteria. This is by far the best way I've found to prompt users for a lot of reasons I won't go into here. Each command must have a "command processing program (CPP)." In that CPP is logic to place the parameter values the user has provided on the command prompt into a one-record file in the job's QTEMP library. That file is defined in the query (it isn't even necessary to join it, by the way; it's just one record) and voila, you have it available for your query selection criteria. The Command Processing Program is then written to run the query, pointing at the parameter file in QTEMP. Do you know CL programming? Do you code in any High Level language (RPG, COBOL)? If not, I can post some command and CL code as a sample for you. I also use a tiny little RPG program to put the records into the "parameters" file in QTEMP. I can give you sample code for that, too.
Guest.Visitor
06-14-2000, 07:42 AM
Ashley, If you don't mind having the queries run interactively on your system (which is normally a bad thing), RunQry has a select records option. <pre> RunQry qry(thequeryname) rcdslt(*yes)</pre> When you run this, it will bring up the record selection screen and allow any of the selection criteria to be changed. Bill
B.Myrick
06-14-2000, 08:12 AM
Ashley, I would look into Query Management Queries. This will give you many options not available with normal /400 Query. I don't use it myself, but I have friends that swear by it. 'Course being in the Army, they swear a lot. :p Have you considered IBM or a third party SQL? I use SQL and SEQUEL for much of my sorting and such. SQL can also be called from CL and RPG. What about OPNQRYF? It is powerful for sorting and keying and all kinds of things. There is an excellent book in the MC bookstore called OPNQRYF Magic, I believe. Hope this helps, Bret
Guest.Visitor
06-14-2000, 08:57 AM
Yes I do code in RPGIV. It's just that I've never had to do this type of thing before an I didn't want to write a CL and RPG program to accomplish this little task. I am currently looking into the QM Query objects. Wich me luck on exploring this new (to me) frontier. Ashley Johnson
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.