Using the File Content Checker command
Batch Scheduler has a built-in File Content Checker command that can be used to check the contents of a file for a specified value at a specified location within the file.
To use the File Content Checker, set up a normal Job Definition. For the Job Command, enter the following built-in command.
FILECHECK
The Parameters used with this command are as follows:
FILENAME FROM=S/E OFFSET=### VALUE='XXXXX'
Below is a description of each parameter:
FILENAME
Name of file to check. If the file is not found, this job will fail. You can use the FILEWATCH command to ensure the file is present.
FROM=S/E
Specify S or E for START or END. This tells the command that the following offset is relative to the Start of the file or the End of the file.
OFFSET=###
Specify the position offset from the Start or End of the file to look for content.
VALUE='value'
This is the value that you are checking for. If the data at the specified offset matches this value, the job will succeed. Otherwise the job will return a failed status.
Example
Given the following FILECHECK parameters:
c:\test.dat FROM=S OFFSET=50 VALUE='01/01/2002'
The above filecheck would look in file c:\test.dat at offset 50 from the Start of the file. It will succeed if the data at this file location equals the value specified(01/01/2002).
Index
Home