AS400 Tutorials

Query/400 Keeps On Going

October 12th, 2009 by John

One of the most used tools for years and years has got to be hands down Query/400. It just keeps on working and is incredibly simple to use! Even better is that queries built using this tool work even through OS upgrades without any sort of issues.

Query/400 is completely menu driven, making it very easy to use and friendly from a user standpoint so you don’t have to learn any complicated syntax or SQL… although it can certainly help if you do know SQL.

To fire up Query/400 simply type in “WRKQRY” on a command line and you should be greated with a simple looking screen asking you to build a new query or modify an existing one.

wrkqry

Once you enter in the name of your query definitition you will be brough to a menu of options. Now for probably 90% of the queries you will write you will probably only ever use the options for:

Specify file selections
Select and sequence fields
Select records

definequery

This gives you a straight up query of one or more files with as many constraints as you can possibly think of. Sometimes you will add an option to sort by one or more fields.

One handy feature of Query is using the F5 key to run and preview the report. But keep in mind that when you run this option is can consume a lot of system resources especially if temporary indexes have to be built. The simple rule of thumb is the longer it takes for something to show up when pressing F5 the less often you should use it when building your queries.

previewreport

I like Query/400 *alot* and although I don’t write many permanent queries that are saved and used I find it an indespensible tool for quick and dirty reports to validate data or for looking up information. Even though Query/400 has been around for ages and ages it is still a great tool and because of its versatility I highly recommend you use it for all of your report building and data inquiry needs.

Tags: No Comments

0 responses so far ↓

Like gas stations in rural Texas after 10 pm, comments are closed.