Validate File Process
Use file maintenance to validate an archive, archive index, or an extract file. The validation process determines whether a file is usable and uncorrupted. Validating an archive file, automatically validates any existing index file. If you validate an archive file that is not registered, the report contains a notation to that effect.
Command File Syntax
The command file contains
parameters that identify the files to be validated. A command can
appear several times in a command file. A single command can span
multiple lines for ease of maintenance (except where noted otherwise).
A group of commands followed by a RUN command represents
a “process block.” Except for the RUN command, all
commands in a process block can appear in any order.
A command file can contain one or more process blocks in the following format:
[// comment ]
[ OPTIMDIR optimdirectory ]
[ AF | XF | { severname | (local) } filename1[,filenamen ]
[ COLLECTION collection1[,collectionn]]
[ AFEXCLUDE archivefilename1[,archivefilenamen]]
[ LEVEL 1 ]
[ ONERROR{ CONTINUE | QUITPROCESS | QUITALL }]
RUN VALIDATE
- //
- At the beginning of a line, indicates that the text that follows the slashes is a comment. Enter comment text on one line, anywhere in the command file.
OPTIMDIR- The directory for the files to be validated. The directory provides complete file names in case a wildcard name is specified. For archive files, the directory is used in conjunction with the AF and COLLECTION parameters. For extract files, it is used in conjunction with the XF parameter. The specified AF, XF or COLLECTION must be in the directory specified by OPTIMDIR. (The default is the current directory.)
AF | XF- The files to be processed. You can specify either XF or AF in
a process block, but not both. You can use AF and COLLECTION together
in a process block.
{ servername | (local) } filename1,filenamen- Server name followed by a comma-separated list of file names or
patterns with wildcards. Use the wildcard
%for any number of characters. If a file name contains spaces, enclose the name in quotations. An archive file must be registered to be validated. You can use multiple occurrences of this command to process files on multiple servers.
COLLECTION- The collection for archive files to be processed. If both AF and
COLLECTION are specified, the final list of files to be processed
contains only unique files.
collection- Comma-separated list of collection names or patterns with wildcards
(
%for any number of characters). If a collection name contains spaces, enclose the name in quotations.
AFEXCLUDE- Archive files to be excluded from validation. If both AF and COLLECTION
are specified, the final list of files to be processed contains only
unique files. This parameter is valid only for archive files.
archivefilename- Comma-separated list of archive file names to exclude from the validation list. If a file name contains spaces, enclose the name in quotations.
LEVEL 1- Specify this parameter to validate the file. Performs these actions:
- Opens the file
- Reads and validates header and trailer blocks
- Checks and validates table and column structures
- Closes the file
ONERROR- Indicates the action taken when an error occurs:
CONTINUE- Processing continues with the next file, if possible.
QUITPROCESS- Processing ends with the current process and proceeds to the next.
QUITALL- Processing ends immediately. (Default)
RUN- Identifies operation to run. The
RUNcommand and its value indicate the end of a process block. Any commands that follow theRUNcommand are part of the next process block. (Required.)VALIDATE- Validates specified files.
Command File
The following command line validates files specified in command.txt, the command file. The process report is written to filemaint.txt.PR0CMND /FMF
OUTPUT=C:\RTDATA\filemaint.txt
@command.txt
The following is an example
of the contents of a command file used by the file maintenance process.//This is the first block.
OPTIMDIR OPTIMDIR1
AF OPTIMSVR1 PAYROLL%.AF,GENERAL_LEDGER.AF
LEVEL 1
RUN VALIDATE
//This begins the second block.
OPTIMDIR OPTIMDIR2
AF (LOCAL) ACCOUNTS_PAYABLE.AF,ACCOUNTS_RECEIVABLE.AF
RUN VALIDATE
//This begins the third block.
XF (LOCAL) PAYABLE.XF,C:/OPTIM/DATA/ACCOUNTS_RECEIVABLE.XF
LEVEL 1
ONERROR CONTINUE
RUN VALIDATE
//This is the fourth block.
OPTIMDIR OPTIMDIR1
AF OPTIMSVR1 PAYROLL%.AF,GENERAL_LEDGER.AF
COLLECTION PAYROLL.COLL1, EMPLOYEE.COLL%
AFEXCLUDE ACCOUNTS_PAYABLE.AF,ACCOUNTS_RECEIVABLE.AF
RUN VALIDATE The following is a sample process report.
File Maintenance Facility (FMF) Process Report
RESULTS Created on 2/21/2013 at 17:13:43
Command Line Parameters @C:\Optim\Data\FMFFileValRun.txt output=ArchiveOut
.txt
Input File C:\Optim\Data\FMFFileValRun.txt
Process Output ArchiveOut.txt
Process Status 1 error, no warnings
Process Summary
Files processed 1
Index files processed 0
Process 1 of 1
------- - -- -
Process Commands:
1) OPTIMDIR DB2DIR
2) AF (local) SampleArchive60.AF,DB2VAL1.AF
3) ONERROR CONTINUE
4) RUN VALIDATE
Entry 1 of 2
File Name C:\Optim\Data\SampleArchive60.AF
Server (Local)
Index File Name (None)
Process Status no errors, no warnings
AD Name (Local) Request XXXXXXX.TESTFVAL
Validation Level 1 Security (None)
File Creation Date 2/20/2013
Validation Summary:
Header/Trailer Passed Archive Index (None)
Table/Column Passed
Entry 2 of 2
File Name C:\Optim\Data\DB2VAL1.AF
Server (Local)
Index File Name (None)
Process Status 1 error, no warnings
FMF Process Errors
Header/Trailer validation failed for the specified source file,
C:\Optim\Data\DB2VAL1.AF. This file may have been corrupted.
AD Name (Unavailable) Request (Unavailable)
Validation Level 1 Security (Unavailable)
File Creation Date (Unavailable)
Validation Summary:
Header/Trailer Failed Archive Index (None)
Table/Column (None)