Kevin Juenemann's Quick Query Utility
Published: October 4, 2006
Note: The source code for this article is available for download
Your QF command works great when you want to see the raw data, but sometimes you need only some of the columns, or need to join files to get usable data rather than codes. Many of our customers don't have interactive SQL installed on their systems, so I created this utility and sent it to all our customers for those times a one-off report is needed quickly.
I can enter an SQL Select statement and a printer ID, and the utility will create a Query Management Query and run it. One nice feature is that if the report is too wide for the paper, it will automatically create multiple reports that you can place side-by-side for a wide-view.
--Kevin Juenemann, InfiniTec
I greatly appreciate Kevin's willingness to share his utility with readers of Four Hundred Guru.
Kevin sent me three source members--a command, a CL program, and an RPG IV program. You can download the source code for each of these elements by clicking here. This file contains:
I have included compilation instructions at the beginning of each member.
Here's an example of how I used PTPRTSEL in testing. The following command created a report and placed it on my output queue.
PTPRTSEL SQL('SELECT STATE, CITY, LSTNAM, INIT, CUSNUM FROM qiws/qcustcdt
ORDER BY STATE, CITY') PRINTER(THOLT)
I hope many of you will find Kevin's utility handy.
Quick Query Over a Database File
Do you need area code information?
Do you need ZIP Code information?
Do you need ZIP+4 information?
Do you need city name information?
Do you need county information?
Do you need a nearest dealer locator system?
We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!
The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.
PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.
Just call us and we'll arrange for 30 days FREE use of either
ZIP/CITY or PER/ZIP4.
WorksRight Software, Inc.
Web site: www.worksright.com
Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
September 30, 2006: Volume 8, Number 37
September 23, 2006: Volume 8, Number 36
September 16, 2006: Volume 8, Number 35
September 9, 2006: Volume 8, Number 34
September 2, 2006: Volume 8, Number 33
August 26, 2006: Volume 8, Number 32
August 19, 2006: Volume 8, Number 31