Purge and archive engine
The Purge and Archive Engine of Database Monitor is designed to be user-callable. There is no menu option that will invoke this program, primarily because archive and purge are serious functions for which considerable attention and planning should be given.
To run the Purge and Archive engine, you must call the program IDT905. Parameters for calling the program are listed in the table below.
Example of the called program syntax:
CALL IDT905 PARM('ARCHIVELIB' 'F' 'PAYROLL' 'TESTER' '' 'Y' 'Y' 'Y' 'Y' 'N')
IDT905 parameters
Parameter |
Description |
Values/Comments |
Length (required/optional) |
---|---|---|---|
Archive Name | Name of archive, which is the name of the library that will be created | Must follow library naming rules for the IBM i | Char(10), Required |
Run Mode | Specifies which files should be included in the run | Values are: A - All files considered F - Specific file G - File group K - One file, by key | Char(1), Required |
File Name | Specify the f | Must match a specific file in Database Monitor | Char(10), Only required if F or K used as run mode. |
Library Name | If a file is specified, specify the library here. | Along with the file, must match a specific Database Monitor file. | Char(10), Required if F or K used as run mode. |
Group Name | Name of Group if G mode used. ...or... Key for the file if K mode used. | If running in G mode, must specify a file group in Database Monitor. If running in K mode, must specify the contents of a file key. Note that this often will require a data structure to hold the various fields making up the key. Each field must be in the same format as the key field in the file (e.g. packed, binary, date, etc.) | Char(10), if G mode. (*), if K mode. |
Include Adds | Include Add events in the purge/archive process? | Specify a Y to include Add events in the run. | Char(1) optional. |
Include Deletes | Include Delete events in the purge/archive process? | Specify a Y to include Delete events in the run. | Char(1) optional. |
Include Changes | Include Change events in the purge/archive process? | Specify a Y to include Change (Update) events in the run. | Char(1) optional. |
Include Reads | Include Read events in the purge/archive process? | Specify a Y to include Read events in the run. | Char(1) optional. |
Purge Only | Purge Only? | Specify a Y in this field to simply delete the qualifying records, without archiving them first. Note that this flag is also able to be specified on the File Retention Maintenance panel. If either that flag or this one is N, then an archive will take place. Only if both are Y will a "purge only" be done. | Char(1) optional. |
Archive concepts
When an archive and purge is run, a library will be created for the archive if it does not already exist. In this library, the system will create the following files: IDTLOH, IDTLOD, IDTSIG, IDTEMH, and IDTEML. Along with these physical files, the corresponding logical files are also created.
If the library already exists, the system will simply append the new archive data to the old. This way, multiple runs of the same archive are allowed, each building upon the other. The general concept is that, if a new archive is desired, it should be created using a new name. Running two separate archives with the same name, but removing/storing the library after the first run, will result in two separate archives with the same name that are not combined in content, thus leading to more difficulty in managing the archive.
So, generally speaking, if an archive is run with the same name as a prior one, the old archive should be resident on the machine when the new one is run.