Contact Us


SQL Query File

Get to where you need to be

Join the 2096 users who have already discovered how SQL Query File solves their data access and reporting challenges with easy-to-use SQL.

SQL Query File for IBM i - Download

Download a fully functioning 60-day trial for IBM i v7.1 or later.

Earliest Supported OS Download Link Downloads Notes
IBM i V7R1M0 SQL Query File V7Rx 2096 Optimized for v7r1 and later. Check out the What's New log for the latest updates.
IBM i5/OS V5R4M0 SQL Query File V5R4 1199 Runs on v5r4 or v6r1 only.
No-charge software license included)

A license key is required to use SQL Query File on IBM i V7R1 and later.

Then get your trial or permanent license key by clicking the button below.

SQL Query File works best with IBM i V7R1 and later. A Special Edition is available at no charge to systems running IBM i5/OS V5R4M0 and or IBM i V6R1M0. This license expires and the software stops operating when those systems are upgraded to IBM i v7.

Compare SQL Query File to RUNSQL/RUNSQLSTM

SQL Query File Installation

SQL Query File is packaged as an IBM i Licensed Program and may be restored using the RSTLICPGM command.

  1. Download the COZQRYFxxx.ZIP file from the link above.
  2. Unzip the file to produce the COZQRYFxxx.SAVF object onto your PC.
  3. Upload the COZQRYFxxx.SAVF object to library QGPL (or similar) on your IBM i system using FTP or another method.
  4. If SQL Query File is already installed on your system, you may need to delete the licensed program before continuing. To delete the LP, run the following CL command:
  5. On the IBM i system,restore the SQL Query File Licensed Program using the following RSTLICPGM 2COZQF2 command, (modify for the save file name, such as COZQRYF540 or COZQRYF710):
  1. Existing customers can stop here. If you already have a license key installed, you are finished.
  2. If you haven't already done so, Register your Company and IBM i Serial Number (note: trial users can skip this step but it can reduce work later on when ordering)
  3. Retrieve your SQL Query File Software License Key (you only need to do this once)

The RSTLICPGM restores the SQL Query File licensed program into library COZQRYF. It then creates proxy commands in QGPL. In most cases, you do not need to include the COZQRYF library on your library list due to these proxy commands being in QGPL and QGPL being part of the user's library list. If you do not have QGPL on your user's library list, or you delete the proxy commands from QGPL, you will need to add COZQRYF to the library list.

Using SQL Query File

To begin using SQL Query File, run the STRQRYF command.




Once the menu appears, you can select the RUNQRYF or RUNSQLF command. Both menu options automatically prompt and their commands are logged for F9 retrieval. The SQL Query File menu contains 3 options.

SQL Query File™ for IBM i Menu

  1. Run SQL using Query File
  2. Run Query File
  3. Work with Fields using Query File

Option 1 prompts and runs the RUNSQLF command, which allows you to directly enter SQL statements to be run, including the SELECT statement--but most SQL statements are supported.

Option 2 launches the RUNQRYF command. RUNQRYF is for those who wish to work with classic CL parameters, such as FILE and FLD, where you enter the file name and you get results. Customization of the RUNQRYF parameters is provided for field selection, sorting, and select/omit. 

Option 3 prompts the WRKQRYF command. This command allows you to type in a File name. The file layout or record format (i.e., the list of fields that make up the file) is listed. From the Work with SQL Query File display, you can immediately press F10 to run a query over the data in the file, or you can select the fields you want to include in the query. The sequence of those fields may be specified while selecting them; similar to other interfaces on the system.

For examples of using the RUNQRYF and RUNSQLF commands, visit our samples page

Product Information

  • Name: SQL Query File
  • Install Library: COZQRYF
  • Product ID: 2COZQF2
  • Earliest IBM i release: V6R1M0 (limited use version available for V5R4M0)
  • Run Query File CL Command: RUNQRYF
  • Run SQL using Query File CL Command: RUNSQLF

Copyright © 2014 Cozzi Productions, Inc. All Rights Reserved.