The Validate Data Base File (VALDBF) command is used to validate data in an externally described database file. It includes validating numeric data in numeric fields and verifying fields against DDS validity-checking specifications (e.g., RANGE, VALUES). Any errors are listed in the report created by this command. The report indicates the name of the file and member that were validated, the relative record number of the record in error, the name of the field in error, a description of the error and the value of the field.
The following restrictions apply when executing this command:
o Floating-point fields are not validated. Character or numeric fields with a length greater than 15 and with validity-checking specifications are not validated.
o Only the first 250 fields in a record are validated. Excess fields are ignored.
o The VALDBF command can validate only one member in the specified file with each execution of the command. If a logical file is specified, it must be a single-format logical file. The Validate Many Data Base Files (VALMNYDBF) command, another QUSRTOOL utility, can be used to validate more than one file member per command execution.
By default, VALDBF creates a file (VALF) in library QTEMP which contains the information about the file being validated. This file is used to execute the validation step and create the report.
You can use the information from the report to modify and correct the erroneous data in the physical file. Unfortunately, IBM's Data File Utility (DFU) won't process records with invalid data; therefore, you will most likely have to use a program to update the file. If a file contains a large number of records with invalid data, you might consider copying the spool file to a database file and using it as input to your update program.
Required Parameters
FILE
Specify the qualified name of the externally described database file that is to be validated. The file can be a physical file or a single-format logical file. The possible library values are:
*LIBL: The library list is used to locate the file.
library-name: Specify the name of the library where the file is located.
file-name: Specify the name of the file.
Optional Parameters
MBR
Specify the name of the member in the file specified in FILE that is to be validated.
*FIRST: The first member in the file is validated.
member-name: Specify the name of the member.
PROCESS
Specify if the validation process is to occur, or if only the validation information is to be created.
*EXEC: Validation information for the file specified in FILE is created, and the member specified in MBR is validated.
*BUILD: Validation information for the file specified in FILE is created. The member specified in MBR is not validated.
VALFILE
Specify the qualified name of the database file where the validation information created by this command is to be kept. The programmer can use this information to write other file analysis functions. The possible library values are:
QTEMP: The validation file is located in library QTEMP.
library-name: Specify the name of the library where the validation file is to be located.
The possible file name values are:
VALF: The validation information is kept in this file.
file-name: Specify the name of the file where the validation information is to be kept.
DLTSPLF
Specify whether or not the spool file created by this command should be deleted if no errors are found.
*NO: The spool file should not be deleted.
*YES: The spool file is deleted if no errors are found.
SAMEFILE
Specify whether or not this command is being executed again for the same file as specified in FILE. This provides a performance enhancement when another member in the file is being processed, as the validation information does not have to be created again for the same file.
*NO: The same file is not being processed. The validation information is created for the file specified in FILE.
*YES: The same file is being processed. The validation information is not created for the file specified in FILE. If this value is specified, the VALDBF command must have been previously executed with SAMEFILE(*NO). You must also specify the name of the previously created validation output file in the VALFILE parameter.
Example
VALDBF FILE(MYLIB/MYFILE) + MBR(MYMBR)
This command validates member MYMBR in database file MYFILE located in library MYLIB. The validation information for this file is constructed and placed in QTEMP/VALF.
Source Members
INFO: VALDBF (QATTINFO) CDO: TAADBFJ (QATTCMD) CPP: TAADBFJC (QATTCL) RPG: TAADBFJR (QATTRPG) RPG: TAADBFJR2 (QATTRPG) PF: TAADBFJP (QATTDDS)
Prerequisite
The following QUSRTOOL tool must reside on your system prior to creation of the VALDBF tool.
EDTVAR
The foregoing article was adapted from Midrange Computing's QUSRTOOL Command Reference. The manual contains explanations and syntax diagrams for more than 300 obscure yet useful tools.
LATEST COMMENTS
MC Press Online