When a database file has become corrupt, you must re-build 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 JCL submission executing the database utility program: MFDBUJCL
With 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.
An example of JCL for restoring a corrupted database is below:
//DBUJCL01 JOB 'IMS DATABASE UTILITY',CLASS=A,MSGCLASS=A //*-------------------------------------------------------------------- //* Copyright (C) 1991-2010 Micro Focus (IP) Limited. //* All rights reserved. //*------------------------------------------------------------------- //* //* THIS JOB REBUILDS THE IMS DEMONSTRATION DATABASE //* 'DBDNP' USING THE IMSDBU JCL INTERFACE MFDBUJCL. //* //* //STEP01 EXEC PGM=MFDBUJCL,PARM='REBUILD' //SYSOUT DD SYSOUT=* //SYSIN DD * INPUT=DBDNP.DAT OUTPUT=DBDNP.OUT.DAT /* //