Jump to content

IBM SPUFI

From Alfawiki
Adapted from the English Wikipedia article IBM SPUFI, available under CC BY-SA 4.0Updated 9 August 2025
SPUFI
Company typeUtility
IndustryDatabase management software
FounderIBM
ProductsSQL Processor Using File Input (SPUFI)
ParentIBM

SPUFI (short for SQL Processor Using File Input) is a utility developed by IBM designed to interact with the Db2 database system. Users access SPUFI through TSO and ISPF, typically from the DB2I Primary Option menu.

SPUFI facilitates the direct entry of SQL statements within the TSO interface, removing the necessity to embed SQL commands within application programs.

SPUFI defaults

The default settings for SPUFI are generally uniform across different environments and seldom modified. Typical configurations include:

Operational workflow

SPUFI functions in an interactive manner by utilizing two z/OS datasets—one for input and one for output—that can be reused in subsequent sessions. On the main SPUFI interface, users designate these datasets before composing SQL commands via the ISPF editor. After exiting the editor, SPUFI runs the SQL statements contained in the input dataset and places the results into the output dataset. The output is then presented in a read-only browse window for examination.

This sequence—main screen → edit input → main screen → view output—supports an effective iterative approach to SQL scripting.

Employing datasets allows users to predefine commands and maintain complex SQL scripts persistently beyond single sessions, thereby enabling continuous management of database queries without losing progress between uses.

SQL statement

An example of a straightforward query including comments. <syntaxhighlight lang="SQL">

-- Retrieve selected columns from EMPLOYEE table
-- for personnel assigned to Department 01.
  SELECT FIRST_NAME, LAST_NAME, DATE_JOINED
    FROM EMPLOYEE
   WHERE DEPARTMENT = '01'
   ORDER BY LAST_NAME DESC, FIRST_NAME

</syntaxhighlight>

Output

A typical response generated by this query.

The output dataset displays the returned rows (for SELECT queries) along with metadata such as number of rows processed and SQLCODE status. Any errors encountered provide corresponding diagnostic information.

References

DB2 Developer's Guide, Craig S Mullins, Sams Publishing

See also