i-effect Manual
German English
German English

STREFREORG, reorganize i-effect

This page describes STREFREORG as of release 3.1.19. The reorganization runs while i-effect is active; there is no need to end i-effect. Only LOG(*ALL) requires all i-effect subsystems to be ended (IEFFECT/ENDEFFSBS SUBSYSTEM(*ALL)).

Usage

With the command STREFREORG (menu item 83) you reorganize the logbook and the IFS directories of i-effect. Without regular reorganization, the logbook tables and the archive, error and log directories grow without limit. We recommend scheduling STREFREORG as a regular job, for example monthly.

What is reorganized

  • Sessions: The unit of reorganization is the session. A session that started before the cutoff date is reorganized together with all its logbook entries (actions, transactions, documents, forwarding log, monitoring) and with the files the logbook refers to.

  • Cutoff date: The cutoff date is always the first day of a month. The current month and the number of full months given in MONTHS before it are kept.

  • Files without a reference in the logbook in the archive, error and internal directories are reorganized by their age. This includes the log files /home/ieffect/internal/*.log.

  • Directories: They are determined automatically from the module configuration, from the config.xml of the mapper and ZUGFeRD, and from the archive directories the logbook refers to. Further directories can be added with DIR.

  • Temporary work directories (#n) are removed when they are older than 2 days and no file in them is in use. The work directories of the server are only removed while no server task is working.

Never removed are:

  • Send directories. Their old files are only counted and reported.

  • Open sessions whose job is still active, and the reorganization's own session.

  • Files a kept session refers to, even if they are older than the cutoff date.

Parameters and their meaning

Parameter

Value

Description

MONTHS

*DAY (default)

The cutoff date is taken from the parameter DAY.


Number

Number of full months kept in addition to the current month. Example: MONTHS(3) on 2026-11-20 keeps November and the months August to October. Everything before 2026-08-01 is reorganized. MONTHS takes precedence over DAY.

DAY

30 (default)

Number of days, converted into full months: (days + 15) / 30, at least 1 month. DAY(30) equals MONTHS(1). Only used with MONTHS(*DAY).

LOG

*SELECT (default)

Sessions before the cutoff date are removed together with their entries and files.


*ALL

All sessions, logbook entries and files are removed; afterwards the session, transaction and file numbers are reset to 1. Only allowed while no i-effect subsystem is active (WebControl and the service count as active), otherwise the command ends with message IEF0290.

ARCHIV

*NO (default)

The data is removed without an archive.


*YES

All data removed in this run, both database content and IFS files, is first saved in a ZIP archive. Nothing is removed until the archive is complete and verified. See section Archive.

ARCPATH

Path name

Location of the ZIP archive, only with ARCHIV(*YES). Either a directory, for example /home/ieffect/reorg, then the archive is named ieffect-reorg-<timestamp>.zip. Or a file name ending in .zip, then the archive is named <name>-<timestamp>.zip. Every run creates its own archive; an existing archive is never overwritten.

DRYRUN

*NO (default)

The reorganization is performed.


*YES

Test run: only counts, per table the records and per directory the files that would be reorganized. Nothing is changed.

DLTJRNRCV

*NO (default) / *YES

With *YES the detached journal receivers of the logbook database are removed.

DLTSQLPKG

*NO (default) / *YES

With *YES the SQL packages of the logbook database are removed.

DIR

*NONE (default)

No further directories are reorganized.


List (up to 50)

Further directories, for example customer-specific folders. Per entry:

  • Element 1: absolute path or one of the special values *INTERNAL, *ERROR and *ARCHIVE. A special value only takes effect with own days (element 5): these days then apply instead of the cutoff date to all internal, error or archive directories, and with element 4 *NO their files are removed without archive. Mask, subdirectories and omitted files do not apply; the directories are always processed completely. Without own days the special value has no effect (IEF0845).

  • Element 2: file mask, default '*.*'. Wildcards are ? and *.

  • Element 3: include subdirectories, *NO (default) or *YES.

  • Element 4: archive. Files are only archived with ARCHIV(*YES). *DFT and *YES: the files go into the archive. *NO: the files are removed without archive, even with ARCHIV(*YES). With ARCHIV(*NO) the files are always removed without archive, even with *YES.

  • Element 5: age in days. With *DFT the cutoff date from MONTHS or DAY applies.

  • Element 6: file masks to omit, up to 50.

Files a kept session refers to are always kept.

Parameters no longer used

The parameters MODULES, LOGBOOK, WCNOTICES, FWDLOGBOOK, VORGANG, RGZPFM, CRTSQLIND, CRTSQLVIEW and PRCEFFIFS are no longer used as of release 3.1.19. The reorganization always covers all modules, the logbook together with its files, and all i-effect directories. The parameters are still accepted for existing job schedules. If a value differs from the former default, this is noted in the logbook with message IEF0841.

  • RGZPFM is no longer needed: all logbook tables reuse deleted records (REUSEDLT(*YES)).

  • Indexes and views no longer need to be recreated, because the tables are no longer reorganized.

Archive

With ARCHIV(*YES) the ZIP archive contains

  • the reorganized logbook data as the save file of a library,

  • all removed files with their original path,

  • a manifest (ieffect-reorg/manifest.txt) with the cutoff date, the number of sessions and the records per table, and the list of files.

Before archiving, the command checks that there is enough space in the target directory. If space is missing, the reorganization ends with message IEF0843 without removing anything.

The archive can be restored in WebControl and displayed there, see Restore reorganized archive. Archives of the reorganization before release 3.1.19 can no longer be restored.

Recommendation for the first run

If there has been no reorganization for a long time, millions of records and files may be affected. Proceed step by step for the first run.

  1. Use a test run to find out how much would be reorganized: STREFREORG MONTHS(24) DRYRUN(*YES).

  2. Start with a high number of months, for example MONTHS(24), and reduce the value step by step in further runs until you reach the desired value. This keeps every run manageable.

  3. With ARCHIV(*YES), check the space in the target directory beforehand.

  4. Then schedule STREFREORG with the desired value as a regular job.

Log

Every run has its own session, module *BASE. The logbook shows the start with mode and cutoff date (IEF0830), the number of records per table (IEF0831, IEF0838) and the number of files per directory (IEF0832, IEF0839). At the end, a summary shows the sessions, records, files and data volume (IEF0833). In addition, every run is logged in the file /home/ieffect/internal/<date>-reorg.log.

Performance

Records are removed in packages of whole sessions, so no long locks are held. The large logbook tables are emptied at the same time, and files are listed and removed by several processes at the same time. The package size and the number of processes can be changed with the environment variables IEFFECT_VxRyM0_REORG_DELETE_WITH_ROWCOUNT (default 100000) and IEFFECT_VxRyM0_REORG_PARALLEL (default 8, at most 64), see Environment variables.

Changes from earlier releases

  • DAY is converted into full months. A scheduled STREFREORG DAY(3) therefore keeps at least the current and the previous month as of 3.1.19.

  • Existing job schedules with the parameters no longer used continue to run unchanged.

  • i-effect no longer has to be ended for the reorganization.

Examples

Description

Command

Test run: count what would be reorganized with three months kept

IEFFECT/STREFREORG MONTHS(3) DRYRUN(*YES)

Save everything before the cutoff date (three months kept) in a ZIP archive, then remove it

IEFFECT/STREFREORG MONTHS(3) ARCHIV(*YES) ARCPATH('/home/ieffect/reorg')

Also remove CSV files older than 30 days from a custom directory, without archive

IEFFECT/STREFREORG MONTHS(3) DIR(('/home/ieffect/data/out' '*.csv' *NO *NO 30))

Keep the archive and internal directories for only 2 days, the logbook for three months

IEFFECT/STREFREORG MONTHS(3) DIR((*ARCHIVE '*.*' *NO *DFT 2) (*INTERNAL '*.*' *NO *DFT 2))

Empty the logbook completely and reset the numbers (i-effect ended)

IEFFECT/STREFREORG LOG(*ALL)

STREFREORG in releases before 3.1.19

In older releases you also reorganize the logbook and the IFS directories with STREFREORG. The following differences apply:

  • Days only, no MONTHS: The cutoff is given only with DAY as a number of days. Sessions and transactions that started or were registered more than DAY days ago are reorganized. The value is not rounded to full months.

  • No DRYRUN: A test run is not possible; every call removes data. You can count the affected sessions and transactions beforehand with SQL (see below).

  • Scope by parameters: The parameters LOGBOOK, VORGANG, WCNOTICES, FWDLOGBOOK, MODULES and DIR (before 3.1.14: PRCEFFIFS) are in effect. WebControl notices (WCNOTICES) and the forwarding log (FWDLOGBOOK) are only reorganized with *YES.

  • Archive: ARCPATH is the name of the ZIP file, for example /home/ieffect/reorg/reorg-2026-11.zip. The archive is created by the module *ZIP, so i-effect must be active. These archives can no longer be restored as of release 3.1.19.

  • Run time: The records are removed in a few large steps, which can cause long locks. Run the reorganization outside the main processing hours. If there has been no reorganization for a long time, start with a high DAY value, for example DAY(730), and reduce it step by step in further runs.

  • End i-effect for RGZPFM, CRTSQLIND and CRTSQLVIEW: For these parameters STREFREORG does not check whether i-effect is active. End i-effect beforehand anyway (IEFFECT/ENDEFFSBS SUBSYSTEM(*ALL)).

    • RGZPFM(*YES) (or environment variable IEFFECT_RGZPFM_LOGFILES=*YES): RGZPFM … ALWCANCEL(*NO) needs an exclusive lock. While the subsystems are running, this step will probably fail because of locks.

    • CRTSQLIND(*YES) / CRTSQLVIEW(*YES): Indexes and views are dropped and recreated while they may be in use.

Count beforehand instead of a test run

Replace <schema> with the i-effect logbook library and 90 with the planned value for DAY, for example in STRSQL:

SQL
SELECT COUNT(*) FROM <schema>.SITZUNG WHERE DATE(PCSSTRSTP) < CURRENT DATE - 90 DAYS;
SELECT COUNT(*) FROM <schema>.VORGANG WHERE DATE(REGTIMSTMP) < CURRENT DATE - 90 DAYS;

Examples: before 3.1.19 and as of 3.1.19

DAY(90) counts back exactly 90 days. MONTHS(3) also keeps the current month, so everything before the first day of the month three full months earlier is reorganized.

Description

Before 3.1.19

As of 3.1.19

Test run: count what would be reorganized

Not possible, count with SQL as shown above

IEFFECT/STREFREORG MONTHS(3) DRYRUN(*YES)

Remove logbook data older than about three months

IEFFECT/STREFREORG DAY(90)

IEFFECT/STREFREORG MONTHS(3)

Also remove WebControl notices and the forwarding log

IEFFECT/STREFREORG DAY(90) WCNOTICES(*YES) FWDLOGBOOK(*YES)

IEFFECT/STREFREORG MONTHS(3)

Always included

Save in a ZIP archive before removing

IEFFECT/STREFREORG DAY(90) WCNOTICES(*YES) FWDLOGBOOK(*YES) ARCHIV(*YES) ARCPATH('/home/ieffect/reorg/reorg-2026-11.zip')

IEFFECT/STREFREORG MONTHS(3) ARCHIV(*YES) ARCPATH('/home/ieffect/reorg')

Also remove CSV files older than 30 days from a custom directory, without archive

IEFFECT/STREFREORG DAY(90) DIR(('/home/ieffect/data/out' '*.csv' *NO *NO 30))

As of 3.1.14

IEFFECT/STREFREORG MONTHS(3) DIR(('/home/ieffect/data/out' '*.csv' *NO *NO 30))

Empty the logbook completely and reset the numbers

IEFFECT/STREFREORG LOG(*ALL)

End i-effect beforehand (recommended)

IEFFECT/STREFREORG LOG(*ALL)

i-effect must be ended