How to find corrupted records in physical files

Source: Internet
Author: User
How do I find corrupted records in physical files?
The CL source program provided below can help you find damage records in physical files, but does not support other files.
File Types in the system, such as/qcnt and/qopt. Other types of objects on OS/400 are not supported.

If your OS version is earlier than r420, the program requires a logical file to support:
/**********************************/
R record pfile (qsys/qadbxref)
Dbxfil
Dbxlib
Dbxrecognition
Dbxrdl
K dbxlib
K dbxfil
/**********************************/

The following is the CL source program, which can be run by compiling the program into executable code.
**************************************** ******************************
** Note :------------------------------------------------------**
** Do not run this program on the production machine !! Please perform a full test on the testing machine before running it !! -**
**************************************** ******************************

/* Accept two parameters, the range of libraries to be scanned -----*/
/* Do not forget to check files starting with $ ,@,#---------------*/
/* If you want to scan everything, start with $ and ----------------*/
/* End with z999999999 ---------------------------------------------*/

/* Warning:-a small spooled file will be created for each ----------*/
/* File tested. If no errors are found, the spool * // * file is empty .*/

PGM parm (& start & End)

/* Library to start --------------------------------------------*/
Dcl var (& START) type (* char) Len (10)

/* Library to stop after --------------------------------------------*/
Dcl var (& End) type (* char) Len (10)
Dcl var (& nbrrcds) type (* dec) Len (6)
Dclf file (checklf) alwnull (* yes)

Chgjob log (4 30 * seclvl) logclpgm (* No)
Ovrprtf file (* prtf) Hold (* yes)

/* Position in the file to the partial key library name ------------*/
Ovrdbf file (checklf) position (* keyae 1 record + & START) opnscope (* job)
RCF: rcvf
Monmsg msgid (cpf0864) exec (goto cmdlbl (endp ))
Chgvar VAR (& nbrrcds) value (32000/& dbxrdl)
Ovrdbf file (& dbxfil) opnscope (* job) seqonly (* Yes + & nbrrcds)
If cond (& dbxlib> & End) Then (goto cmdlbl (endp ))
If cond (& dbxrecognition = 'pf '│ & dbxrecognition = 'tb') Then (DO)
If cond (& dbxrdl> 4) Then (DO)
Cpyf fromfile (& dbxlib/& dbxfil) tofile (* print) +
Frommbr (* All) fromrcd (1) incchar (* RCD 1 + * EQ '[-')
Monmsg msgid (cpf0000)
Enddo
Enddo
Dltovr file (& dbxfil)
Goto cmdlbl (RCF)
Endp:
Endpgm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.