Other ERPsFree calculatorPDF, Excel, Word exportInfor XAAll Infor XA tools

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

rows

NUMBER_ROWS from QSYS2.SYSTABLESTAT

bytes

From DSPFD AMFLIB/IMHIST

rows
rows
bytes
rows
bytes
36 months
months
%

Your results

Steady-state size after purge
5.6952
GB. Monthly rows x retention months x record length, plus access path overhead.
Disk returned after purge and RGZPFM
7.9128
GB. Only returned once the files are reorganised.
Size factor including access paths
1.4
Current estimated history size
13.608
GB. IMHIST from actual rows; MO and CO history from monthly rate x months on file.
Rows removed by the purge
9,560,000
Growth per month at steady state
0.1582
GB per month that the next purge has to remove.

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.

Save results:

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.

Was this tool useful?

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.

ArchRay builder
Design the on-prem AI stack for Infor XA: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

Keep exploring

Free tools

ERP fixes and how-tos

Guides

AI on your ERP

Integrations

Comparisons

Software