Issuing the Job Execution Result Notification request
Execution results of jobs that are run by HULFT can be notified to the remote host.
The service is called the service name "HULSNDRC".
To make the Job Execution Result Notification command run, insert the Job Execution Result Notification command (HULSNDRC) at the end of the job.
(1) Job Execution Result Notification command
Program interface
CALL Library name/HULSNDRC PARM(['LIB=Library name'] ['J=jobname']
['R=returncode'] ['M=usermessage'] 'H=hostname' ['I=intervaltime']
['C=retrycount'] ['G'] ['OUTPUT=filename'] ['EXIT' CL variable name])
Explanation of parameters
- LIB=Library name
-
Library name in which HULFT is installed ("HULFT" by default)
Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.
- J=jobname
-
Job Name to be notified (Optional)
Specify this parameter as an alphanumeric character string of 60 bytes or less starting with an alphabet.
If omitted, a space is sent as a notification
- R=returncode
-
Status code to be notified (Optional)
Specify this parameter as an alphanumeric character string of 4 bytes or less.
If omitted, "0" is notified.
- M=usermessage
-
Message to be notified (Optional)
Specify this parameter as an alphanumeric character string of 128 bytes or less.
If omitted, a space is sent as a notification
- H=hostname
-
Host name to be notified (Mandatory)
Specify this parameter as an alphanumeric character string of 68 bytes or less.
- I=intervaltime
-
Retry interval in the event of socket connection failure (Seconds) (Optional)
Specify this parameter in the range of "0" to "999".
If omitted, the retry interval of "0" second is used.
- C=retrycount
-
Retry count in the event of connection failure (Optional)
Specify this parameter in the range of "0" to "99".
When omitted, HULFT does not retry connection.
- G
-
Control of error messages that the Job Execution Result Notification command outputs (Optional)
When omitted, HULFT displays error messages.
- OUTPUT=filename
-
Destination of the error messages that the Job Execution Result Notification command outputs (Optional)
Specify this parameter in the format of Library name/File name(Member name).
When omitted, error messages are not output.
The number of log records that a log file can retain is unlimited.
- EXIT CL variable name
-
Specifies to receive the error code output by the Job Execution Result Notification command and specifies the CL variable name to set the error code value (Optional)
The CL variable name must be immediately after the EXIT tag.
HULFT sets an error code to the CL variable only if the command ends unsuccessfully.
When omitted, an error code is not set.
You cannot omit all of the parameters of "J=", "R=", and "M=" at the same time. You must specify at least one of them.
Command interface
HULSNDRC HOSTNAME( ) JOBNAME( ) RETURNCODE( ) MESSAGE( ) INTERVAL( )
RETRYCOUNT( ) LIBRARY( ) MSG( ) FILE( ) MBR( )
Explanation of parameters
- HOSTNAME
-
Host name to be notified (Mandatory)
Specify this parameter as an alphanumeric character string of 68 bytes or less.
- JOBNAME
-
Job Name to be notified (Optional)
Specify this parameter as an alphanumeric character string of 60 bytes or less starting with an alphabet.
If omitted, a space is sent as a notification
- RETURNCODE
-
Status code to be notified (Optional)
Specify this parameter as an alphanumeric character string of 4 bytes or less.
If omitted, "0" is notified.
- MESSAGE
-
Message to be notified (Optional)
Specify this parameter as an alphanumeric character string of 128 bytes or less.
If omitted, a space is sent as a notification
- INTERVAL
-
Retry interval in the event of socket connection failure (Seconds) (Optional)
Specify this parameter in the range of "000" to "999".
If omitted, the retry interval of "0" second is used.
- RETRYCOUNT
-
Connection retry count when HULFT retries for connection (Optional)
Specify this parameter in the range of "00" to "99".
When omitted, HULFT does not retry connection.
- LIBRARY
-
Library name in which HULFT is installed ("HULFT" by default)
Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.
- MSG
-
Control of error messages ("*YES" by default)
- *NO :
-
Suppress error messages.
- *YES :
-
Show error messages.
- FILE
-
Name of the library and the file to which error messages are output (Optional)
Specify this parameter in the format of Library name/File name.
Specify these names as an alphanumeric character string of 10 bytes or less starting with an alphabet, respectively.
When omitted, error messages are not output. The number of log records that a log file can retain is unlimited.
- MBR
-
Member name of the file to which error messages are output ("*FILE" by default)
Specify this parameter as an alphanumeric character string of 10 bytes or less starting with an alphabet.
(2) Example of CL program
0001.00 START: PGM PARM(&HOST2 &STATUS &FILEID)
0002.00 /*ARG AREA*/
0003.00 DCL VAR(&HOST2) TYPE(*CHAR) LEN(32)
0004.00 DCL VAR(&FILEID) TYPE(*CHAR) LEN(8)
0005.00 DCL VAR(&STATUS) TYPE(*DEC) LEN(15 5)
0006.00 DCL VAR(&J) TYPE(*CHAR) LEN(63)
0007.00 DCL VAR(&M) TYPE(*CHAR) LEN(131)
0008.00 DCL VAR(&R) TYPE(*CHAR) LEN(7)
0009.00 DCL VAR(&H) TYPE(*CHAR) LEN(35)
0010.00 DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
0011.00 /*WORK AREA*/
0012.00 DCL VAR(&WSTATUS) TYPE(*DEC) LEN(4 0)
0013.00 /*CHAR AREA*/
0014.00 DCL VAR(&CSTATUS) TYPE(*CHAR) LEN(4)
0015.00 /* CHANGE TYPE *DEC -> *DEC */
0016.00 CHGVAR VAR(&WSTATUS) VALUE(&STATUS)
0017.00 /* CHANGE TYPE *DEC -> *CHAR */
0018.00 CHGVAR VAR(&CSTATUS) VALUE(&WSTATUS)
0019.00 CHGVAR VAR(&H) VALUE('H=' *CAT &HOST2 *CAT &NULL)
0020.00 CHGVAR VAR(&R) VALUE('R=' *CAT &CSTATUS *CAT &NULL)
0021.00 CHGVAR VAR(&J) VALUE('J=' *CAT &FILEID *CAT &NULL)
0022.00 CHGVAR VAR(&M) VALUE('M=TEST CL' *CAT &NULL)
0023.00 CALL PGM(HULFT/HULSNDRC) +
0024.00 PARM(&H &J &R &M 'G' 'OUTPUT=MYLIB/MSG(MSG)')
0025.00 END: ENDPGM
Specifying this program as the post-receive job allows you to view the result of job execution on the sending side, even when Notification is set to "T".