ptf
IBM i PTF Management
Monitor and analyze Program Temporary Fixes (PTFs), PTF groups, and patching status using SQL services from QSYS2 and SYSTOOLS.
Available Tools
The ibmi CLI is the primary tool for executing PTF queries. Set SKILL_DIR to this skill's installed location (the directory containing this SKILL.md file):
# SKILL_DIR = directory containing this SKILL.md
# Examples: ./skills/ptf, ~/.claude/skills/ptf
# List all PTF tools
ibmi tools --tools "$SKILL_DIR/tools/" --toolset ptf_default
# Run a specific tool
ibmi tool check_ptf_currency --tools "$SKILL_DIR/tools/"
# Ad-hoc SQL for custom queries
ibmi sql "SELECT * FROM QSYS2.GROUP_PTF_INFO WHERE PTF_GROUP_STATUS = 'INSTALLED'"
The ibmi-mcp-server also provides execute_sql and describe_sql_object for MCP-connected agents.
Service Selection Guide
PTF Group Currency (requires internet access)
- SYSTOOLS.GROUP_PTF_CURRENCY -- Compare installed vs available PTF group levels
- SYSTOOLS.DEFECTIVE_PTF_CURRENCY -- Check for IBM-identified defective PTFs
PTF Group Information (local data)
- QSYS2.GROUP_PTF_INFO -- Installed PTF groups, levels, status, and target release
- SYSTOOLS.GROUP_PTF_DETAILS -- Individual PTFs within a PTF group
Individual PTFs
- QSYS2.PTF_INFO -- All individual PTFs with product, status, and timestamps
Key Capabilities
Currency Monitoring
- Group Currency -- Compare installed vs available levels for all PTF groups
- Outdated Groups -- Find groups with updates available, ranked by levels behind
- Critical Updates -- Identify groups significantly behind threshold
- Summary Dashboard -- Count of current, outdated, and unavailable groups
PTF Group Management
- Installed Groups -- List all PTF groups with status and release filtering
- Group Details -- Drill into a specific PTF group's installed levels
- Status Tracking -- Filter by INSTALLED, APPLY AT NEXT IPL, etc.
Individual PTF Tracking
- Product Filtering -- List PTFs by product ID (5770SS1, 5770WDS, etc.)
- Status Filtering -- Find APPLIED, PERMANENTLY APPLIED, SUPERSEDED PTFs
- Supersession Chain -- Track which PTFs supersede others
Compliance
- Defective PTFs -- Check for PTFs IBM has flagged as defective
- Patch Level Summary -- Overall system patching health at a glance
Common Use Cases
- Patch compliance check -- Verify all PTF groups are current
- Find outdated groups -- Identify which groups need updates
- Critical update triage -- Prioritize groups most levels behind
- Pre-IPL planning -- Find PTFs pending apply at next IPL
- Product-specific PTFs -- List PTFs for a specific licensed program
- Defective PTF scan -- Check if any installed PTFs are defective
- PTF group drill-down -- Examine levels within a specific group
- Patching summary -- Quick dashboard of overall PTF health
Quick Examples
Check all PTF group currency
ibmi tool check_ptf_currency --tools "$SKILL_DIR/tools/"
Find groups with updates available
ibmi tool list_outdated_ptf_groups --tools "$SKILL_DIR/tools/"
List PTFs for a product
ibmi tool list_individual_ptfs --tools "$SKILL_DIR/tools/" product_filter=5770SS1
PTF currency summary
WITH iLevel(iVersion, iRelease) AS (
SELECT OS_VERSION, OS_RELEASE FROM SYSIBMADM.ENV_SYS_INFO
)
SELECT PTF_GROUP_CURRENCY, COUNT(*) AS CNT
FROM iLevel, SYSTOOLS.GROUP_PTF_CURRENCY P
WHERE PTF_GROUP_RELEASE = 'R' CONCAT iVersion CONCAT iRelease CONCAT '0'
GROUP BY PTF_GROUP_CURRENCY;
Find superseded PTFs
SELECT PTF_IDENTIFIER, PTF_PRODUCT_ID, PTF_SUPERSEDED_BY_PTF
FROM QSYS2.PTF_INFO
WHERE PTF_SUPERSEDED_BY_PTF IS NOT NULL
ORDER BY PTF_STATUS_TIMESTAMP DESC
FETCH FIRST 20 ROWS ONLY;
Pre-built Tools
The tools/ptf.yaml file provides 8 ready-to-use tools:
| Tool | Description |
|---|---|
check_ptf_currency |
PTF group currency status for current release |
list_outdated_ptf_groups |
Groups with updates available, ranked by levels behind |
get_ptf_group_details |
Detailed levels for a specific PTF group |
list_installed_ptf_groups |
All installed PTF groups with status and release filters |
summarize_ptf_status |
High-level PTF currency summary with counts |
find_critical_ptf_updates |
Groups significantly behind a threshold |
list_individual_ptfs |
Individual PTFs filtered by product and status |
check_defective_ptfs |
Check for IBM-identified defective PTFs |
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" # Execute
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" --dry-run # Preview SQL
ibmi tools show <tool_name> --tools "$SKILL_DIR/tools/" # View details
Reference Documentation
- PTF Services Catalog -- Available SQL services
- Example SQL Patterns -- Working query examples
- IBM GROUP_PTF_CURRENCY -- View documentation
- IBM PTF_INFO -- View documentation
More from ajshedivy/ibmi-agent-skills
work-management
Query, monitor, and analyze jobs on IBM i using SQL table functions via the ibmi CLI. Use when user asks about: (1) finding jobs by status, user, subsystem, or type, (2) monitoring active job performance (CPU, I/O, memory), (3) detecting long-running SQL statements, (4) analyzing lock contention, (5) checking job queues, (6) scheduled jobs, (7) job logs, (8) replacing WRKACTJOB, WRKUSRJOB, WRKSBSJOB, WRKSBMJOB commands, or (9) any IBM i work management task.
12system-health
Monitor IBM i system health including CPU, memory, disk, ASPs, system limits, and network status via SQL services. Use when user asks about: (1) CPU utilization or system status, (2) memory pool sizes or page faults, (3) disk capacity or ASP usage, (4) system limits approaching thresholds, (5) TCP/IP connections and network status, (6) system activity overview, (7) replacing WRKSYSSTS, WRKDSKSTS, WRKTCPSTS commands, or (8) any system health monitoring task.
4database-performance
Monitor IBM i database performance including index statistics, maintained temporary indexes (MTIs), database monitors, query supervisor thresholds, and materialized query tables. Use when user asks about: (1) index usage or unused indexes, (2) maintained temporary indexes and whether to create permanent indexes, (3) database monitor configuration, (4) query supervisor thresholds, (5) MQT statistics and refresh status, or (6) tables with high MTI overhead.
3template-skill
Replace with description of the skill and when Claude should use it.
3skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
3ibmi
Core skill for working with IBM i systems via the ibmi CLI and ibmi-mcp-server. Provides text-to-SQL methodology, iterative querying best practices, schema discovery, and SQL validation patterns for Db2 for i. Use as the foundation for ANY IBM i task — install this skill first, then add domain-specific skills (ibmi-database, ibmi-system) as needed.
3