Synopsis
(1) To parse a file based on the end pointer:
jobschchecklog -f filename -e regexp [-k key] [-s] [-v] [-z] [-sys subsystem-number](*1)
(2) To delete the end pointer:
jobschchecklog -h -f filename [-k key] [-sys subsystem-number](*1)
(3) To parse the whole file not based on the end pointer:
jobschchecklog -a -f filename -e regexp [-s] [-v] [-z] [-sys subsystem-number](*1)
[-sys subsystem-number] is the option of Systemwalker Operation Manager EE.
Description
The jobschchecklog command parses a file in text format line by line to examine whether regular expression is contained or not.
You can specify from where to start checking by using the option: at either the beginning of the file, or the point immediately after the end point of the last parsing.
The end of parsing can be saved internally, as the end pointer based on the file name with the user name and the key. This end pointer can be deleted by using the option.
If a file contains lines in 2048 bytes or more, the lines after 2049 bytes will be ignored.
You cannot use this command when the server is not running.
Options
-a
Parses the entire file.
-e regexp
Specifies the regular expression to be used for parsing. The following special characters can be used:
^$.*+?[]|()
-f filename
Specifies the file to be parsed.
-h
Deletes the end pointer. The next parsing will start from the beginning of the file specified with filename.
-k key
Specifies a key to remember the end point. If omitted, filename will be used as the key.
-s
If the file does not exist, returns the same value as when the regular expression is not found.
-v
Outputs all the lines that contain the regular expression to standard output.
-z
Reverses the return values between when the regular expression was found and when it was not found.
-sys subsystem-number
In the system with multiple subsystems, this option is used to specify the subsystem that you want to operate. Specify the target subsystem number using a range of 0 to 9. If omitted, the default is subsystem 0.
Return Values
0:
Under the synopsis (1) or (3), if the -z option is not specified it indicates that the regular expression has been found and if the -z option is specified it indicates that the regular expression has not been found. Under the synopsis (2), it indicates that the process has terminated successfully.
1:
Under the synopsis (1) or (3), if the -z option is not specified it indicates that the regular expression has not been found and if the -z option is specified it indicates that the regular expression has been found.
11:
Under the synopsis (1) or (3), it indicates that the file has not been found. This value will not be returned if the -s option is specified.
12:
Under the synopsis (1) or (3), it indicates that the regular expression is inappropriate. This value will be returned in such cases as when ([) and (]) are not corresponding (not by a matched pair of parentheses).
13:
Under the synopsis (1) or (3), it indicates that loading file has failed. This value will be returned if there are no access rights or the file is not an ordinary file.
21:
Indicates that there is an error in specification of options. When invalid option, incorrect values or improper combination of options are specified, this status value is returned.
22:
Indicates that an error regarding the system or user environment occurred.
31:
Indicates that an inter error regarding the Systemwalker Operation Manager environment occurred.
32:
Indicates that an internal error regarding saving the end point has occurred.
35:
Indicates other internal error occurred.
Command Location
Windows | Systemwalker Operation Manager installation directory\MpWalker.JM\bin |
Solaris | /opt/FJSVJOBSC/bin |
HP-UX | /opt/FHPJOBSCH/bin |
AIX | /usr/FAIXJOBSC/bin |
Example
To check if a line starting with the string "ABC" was written to C:\TEMP\file.txt:
jobschchecklog -f C:\TEMP\file.txt -e "^ABC.*" -k key1 |
Execution Result/Output Format
Output example when the -v option is not specified:
CL_FILENAME=C:\TEMP\file.txt |
Output example when the -v option is specified:
ABCDEF: logfile text |
Cautions
If any of the following conditions is met, it is determined that the file was replaced. So parsing (checking) must be performed from the beginning of the file after deleting the end point:
The size of the entire file is smaller than that of up to the end point in the file.
The character at the end point is not a line feed character.
When the last line in the file does not contain a line feed character, parsing will end at one line before the last line if the -a operand is not specified. And if the -a option is specified, parsing will be performed until the end of the last line.
If parsing will no longer be performed on the file, delete the end point by using the -h option.