Infor XA History File Growth and Purge Retention Simulator
This simulator estimates the disk used by Infor XA history files on IBM i (inventory transaction history in IMHIST, MO history and CO history) and the size they settle at for a chosen retention period. It shows how much space a purge followed by RGZPFM gives back, with a chart of steady-state size against retention months.
Your numbers
NUMBER_ROWS from QSYS2.SYSTABLESTAT
From DSPFD AMFLIB/IMHIST
Your results
Planning estimate only. Access path overhead varies with the number and keys of logical files; take real sizes from QSYS2.SYSTABLESTAT and DSPFD before and after a test purge.
Steady-state history size (GB) by retention months
Sweeps Retention kept after purge from 12 to 120, holding your other inputs fixed.
Plan your XA purge and reorganise
Send us your SYSTABLESTAT output for the history files and your retention rules, and we will return a purge and RGZPFM plan with the expected space returned.
Optional. The tool and every export work without this. No spam.
How to use it
Take the current row count of IMHIST from QSYS2.SYSTABLESTAT (NUMBER_ROWS) and the record length from DSPFD AMFLIB/IMHIST. Estimate monthly rows by comparing two row counts a month apart, or by counting rows for a recent month by transaction date. Do the same for MO history (MOHMST, MOHDTA and MOHTRN, plus MOHRTG if your volumes there are large) and CO history (MBFBREP and MBDRREP), using a weighted average record length. Enter the retention your finance and quality teams have agreed, and the number of months of MO and CO history already on file. The access path overhead covers the logical files built over each physical.
The formula behind it
The rule is simple: after a purge to a fixed retention, a history file holds about monthly rows x retention months, and from then on each purge removes roughly the rows added since the last one. Size in bytes is rows x record length, multiplied by (1 + overhead %) for access paths. Current size uses the actual IMHIST row count and, for MO and CO history, the monthly rate x months on file. Space freed is current minus steady-state size, never below zero.
- Steady GB = (IMHIST/month x len1 + MO/month x len2 + CO/month x len3) x retention x (1 + idx/100) / 1e9
- Current GB = (IMHIST rows x len1 + (MO/month x len2 + CO/month x len3) x months on file) x (1 + idx/100) / 1e9
- Freed GB = max(0, current - steady)
Worked example
With the defaults (8,000,000 IMHIST rows at 600 bytes, 120,000 new rows a month, 40,000 MO history rows a month at 500 bytes, 30,000 CO history rows a month at 700 bytes, 120 months on file and 40% access path overhead) the history files hold about 13.6 GB today. Purging to 36 months leaves about 5.7 GB, so roughly 7.9 GB comes back once the files are reorganised, and the files then grow by about 0.16 GB a month until the next purge. The chart shows that each extra year of retention adds about 1.9 GB at these volumes, which helps when finance asks for seven years instead of three.
Gotchas: purge is not the same as free space
XA has purge functions per application (inventory history, MO history, CO history), and running them deletes records, but on IBM i deleted records stay in the file until it is reorganised with RGZPFM or new records reuse the space because the file has REUSEDLT(*YES). Plan RGZPFM in a window with XA stopped, after a backup, and allow time for access paths to rebuild on the larger files. Check whether restored history (IMHGEN) or old copies of history libraries are still on disk. Confirm retention with finance, audit and quality before purging, because restoring purged history is a manual job.
Frequently Asked Questions
Why did disk space not go down after an XA purge?
On IBM i a purge deletes records, but the space stays allocated to the file as deleted records. It is only returned when the file is reorganised with RGZPFM, or reused by new records if the file has REUSEDLT(*YES). Check NUMBER_DELETED_ROWS in QSYS2.SYSTABLESTAT to see how much space is waiting to be reclaimed.
Which XA history files grow fastest?
Usually IMHIST, the inventory transaction history file, followed by shop activity transaction history in MOHTRN and CO history line items in MBDRREP. The exact order depends on how many transactions you post and how long you have run XA. Query QSYS2.SYSTABLESTAT for the library to see the real ranking.
How many months of history should we keep in XA?
That is a business decision, not a technical one. Finance, tax, customer contract and quality record requirements set the minimum, often several years for some records. A common approach is to keep a shorter period in the live files and archive older history to a separate library or a reporting database before purging.
Does moving to XA Release 10 change history file sizes?
The upgrade itself does not shrink history. It is often a good moment to purge and reorganise first, because smaller files make the upgrade conversion and the backup before it faster. Check the XA 10 documentation for any file changes in your installed applications.
If you want old XA history kept searchable for audits through a private assistant while the live files stay small, we can set that up on your own servers.
Related Tools
Infor XA IBM i SQL Services Health Query Generator
Fill in your XA library, thresholds and subsystem and get five ready-to-run Db2 for i queries for file size, reorganise candidates, inactive users, active XA jobs and history file growth.
Other ERPsInfor XA (MAPICS) AMFLIB Database File Reference
The core Infor XA 9.x/10 physical files in AMFLIB with application area, what one record holds and the usual join partner, so you can find the right table before you write a query.
Other ERPsIBM i Commands for Infor XA Administrators Reference
A lookup of common IBM i CL commands for jobs, output, libraries, objects, data and backups, with what each is for.
Other ERPsInfor XA (MAPICS) Period End Close Checklist
A step by step period end checklist for XA (MAPICS) sites covering cutoff, inventory, work in process, receivables, payables and the ledger.
More Other ERPs tools
See all- MAPICS and Infor XA Private AI Layer Blueprint Generator
- Infor XA Secure Net-Link Setup and Upgrade Checklist
- Infor VISUAL Work Order Status and Structure Reference
- Infor VISUAL Manufacturing Scheduling Checklist
- Infor VISUAL Database Table Reference
- Infor XA (MAPICS) Application Module Reference
- Acumatica Generic Inquiry Design Template
- Acumatica Manufacturing Edition Setup Checklist
- Sage X3 Import Template Worksheet
Keep exploring
Free tools
- Oracle EBS Concurrent Request Purge Retention and Disk CalculatorEstimate how much disk the concurrent request log and output files use, and how large FND_CONCURRENT_REQUESTS stays, for a given Purge Concurrent Request and/or Manager Data (FNDCPPUR) Age value.
- Infor XA AI Assistant Sizing and Value CalculatorSize the GPUs and estimate the monthly value and payback of an on-prem AI assistant for Infor XA users.
- Infor XA Private AI Layer Blueprint GeneratorFill in your Infor XA version, database, hosting and use cases and get a shareable architecture plan for a private AI layer.
ERP fixes and how-tos
- ERP Data Archiving Strategy: What to Archive and What to PurgeHow to decide what ERP data to archive or purge: find the big tables, set retention by record type, keep reports and audits working, and test restores first.
- How to purge concurrent requests and manager data in Oracle EBSHow to schedule Purge Concurrent Request and/or Manager Data in Oracle EBS: the parameters, what is deleted, what else to purge, and mistakes that slow the system.
- Infor XA costing: cost types, roll-up and standard cost setupHow product costing works in Infor XA (MAPICS): standard versus current cost, how roll-up builds cost from BOM and routing, setup order, and common pitfalls.
Guides
- SyteLine SQL Server Maintenance GuideSyteLine SQL Server maintenance guide covering backups and recovery model, index and statistics jobs, integrity checks, and purging history tables safely.
- ERP Data Archiving Strategies Before and After MigrationERP data archiving strategies for migrations: what to purge, retention rules, archive architectures, SyteLine and LN tooling, and compliance-safe access design.
- MAPICS to SyteLine Migration Planning GuidePlan your MAPICS XA or MAPICS AS/400 migration to Infor SyteLine or CloudSuite Industrial. Data mapping, timeline, and risk mitigation strategies.
Integrations
- How to add WhatsApp to Infor XA on IBM iHow to connect WhatsApp Business to Infor XA on IBM i: Db2 for i triggers, data queues, template messages, approvals and replies back into XA safely.
- How to add an AI chatbot to Infor XAHow to add an AI chatbot to Infor XA on IBM i: grounded answers from Db2 for i, internal and customer portals, role-based access, and a fully on-prem option.