jp1exit (Windows only)
- Organization of this page
Format
jp1exit [-ec abnormal-return-code]
Description
After the return code of the program (command) executed by the jp1exec command has been saved, the jp1exit command is used to acquire the return code.
Execution privileges
None
Arguments
-ec abnormal-return-code
Specify the return code to be returned if an internal error of the jp1exit command occurs.
You can specify 0 to 9,999.
If this option is omitted, 172 is set as the return code returned by the jp1exit command when an error occurs.
If an invalid value is specified, 172 is used as the return code of the jp1exit command. The details of the error are output to the standard error output.
Notes
-
This command cannot be used in UNIX.
-
This command can be used only in JP1/AJS3. It cannot be used for a request from JP1/AJS3 to JP1/OJE for VOS3.
-
The jp1exec command returns its own return code, which is different from the return code of the program executed by the jp1exec command.
If it is necessary to evaluate the return code of the jp1exec command itself, use %ERRORLEVEL% or another means to perform error judgment before the jp1exit command is executed.
-
The return code of the program executed by the jp1exec command can be executed only when the jp1exit command is used.
If you want processing to branch according to the return code of the program executed by the jp1exec command, specify the jp1exec and jp1exit commands in pairs (see Example below).
If the jp1exit command is not executed after the jp1exec command is executed, or if the jp1exit command is executed more than once in succession without executing the jp1exec command, the jp1exit command results in an error. In this case, it is not guaranteed that the return code is correct.
If you want to use the return code of the program execute by the jp1exec command as the return code of the batch file, make sure that the jp1exit command is executed at the end of the processing executed by the batch file. If execution of the jp1exit command is followed by some processing (such as another command), the return code of the batch file might be replaced.
-
If the file specified as an argument in the jp1exec command does not exist, the command sends error details to the standard error output, and terminates. In this case, the jp1exit command returns 0 as the return code.
-
To execute the command, set write privileges and read privileges for the OS user who executes the job on the following folders:
If the JP1/AJS3 installation folder is the default installation folder or is in a folder protected by the system:
-
%ALLUSERSPROFILE%\Hitachi\JP1\JP1_DEFAULT\JP1AJS2\log\jpqagent
-
%ALLUSERSPROFILE%\Hitachi\JP1\JP1_DEFAULT\JP1AJS2\log\jpqclient
The default of the %ALLUSERSPROFILE% value is system-drive\ProgramData.
If the JP1/AJS3 installation folder is other than the above:
-
JP1/AJS3-installation-folder\log\jpqagent
-
JP1/AJS3-installation-folder\log\jpqclient
When using the system in a cluster configuration:
-
shared-folder\jp1ajs2\log\jpqagent
-
shared-folder\jp1ajs2\log\jpqclient
-
Example
The following example checks the return code of the executed program to branch subsequent processing:
jp1exec UAP1.exe jp1exit if %ERRORLEVEL% =0 GOTO :next1 Error handling GOTO :end :next1 jp1exec UAP2.exe jp1exit if %ERRORLEVEL% =0 GOTO :next2 Error handling GOTO :end :next2 jp1exec UAP3.exe jp1exit if %ERRORLEVEL% =0 GOTO :next3 Error handling GOTO :end
- Explanation:
-
When the last jp1exit command is executed, the return code of the program executed by the paired jp1exec command becomes the return code of the batch file.
If an error occurs and processing branches to :end, the return code of the last program executed after the corresponding error handling becomes the return code of the batch file.