When a database file has become corrupt and cannot be recovered by any other means, you must rebuild it. This situation is rare, but can occur if, for example, the file was open during a system crash.
To rebuild a corrupted database, use the Rebuild utility. You can execute Rebuild from the command line or from JCL. For complete documentation on using the Rebuild utility from the command line, see Rebuild.
To execute the Rebuild utility from JCL submission using MFDBUJCL:
With these files, the file extension, .DAT may be specified or not. If not specified, it is automatically appended.
If you specify an OUTPUT file, then it becomes the rebuilt file and the INPUT file remains unchanged. In this situation, you must make sure that this output file is renamed to the original file name before it can be used.
You will need as much space as the file to be rebuilt requires, and if you have specified an OUTPUT file to be created in the same directory, then you need to account for the extra space requirement.
//STEP01 EXEC PGM=MFDBUJCL,PARM='REBUILD' //SYSOUT DD SYSOUT=* //SYSIN DD * OUT-PATH=DBPath DB1 DB2 ... DBn /* //where DBPath is the directory where the corrupted database files reside, and DB1, DB2, and DBn represent the names of each database to be rebuilt; however, the number of databases to rebuild is not limited. For example:
//STEP01 EXEC PGM=MFDBUJCL,PARM='REBUILD' //SYSOUT DD SYSOUT=* //SYSIN DD * OUT-PATH=C:\IMS\BACKUP\DATABASES BNKCUST BNKACC BNKATYPE /* //