Job execution

(1) Pre-send Job

You can set the job to start at the point when the Send File or the Send Request is acknowledged.

HULFT starts the Send processing when the started job ends successfully (exit code = 0). When the job ends unsuccessfully, the Send processing is not started. This mechanism can be used, for example, to start a user job to create the target data as soon as the Send File or the Send Request is acknowledged, and to proceed to carry out the Send processing of the data as soon as the data is created.

To use the Pre-send Job function, specify a valid job ID (registered in the Job Information) for Pre-send Job ID (PREJOBID) in the Send Management Information.

(2) Post-send Job or Post-receive Job

You can set the job to start at the point when the Send processing or the Receive processing ends. You can also set different jobs to start depending on whether the Send/Receive processing terminates successfully or unsuccessfully.

To start the job when the Send or Receive processing ends successfully, specify a valid job ID (registered in the Job Information) for Successful Job ID (JOBID) in the Send or Receive Management Information, respectively.

To start the job when the Send processing or the Receive processing ends unsuccessfully, specify a valid job ID (registered in the Job Information) for Unsuccessful Job ID (EJOBID) in the Send or Receive Management Information.

The execution result of the Post-send or Post-receive Job is written to the Post-send Job Execution Log file or the Post-receive Job Execution Log file, respectively.

(3) Replacement of environment variables

If environment variables are used in the startup job, HULFT adds the information of the transfer when the Pre-send Job, the Post-send Job, or the Post-receive Job is started. The list of environment variables that can be used is as follows.

Table 2.1 List of Environment Variables

Variable Name

Replacement Rule

Pre-send

Post-send

Post-receive

$HOST

Replaced with the Send/Receive Host Name

-

$FILEID

Replaced with the File ID

$COUNT

Replaced with the number of records in the file that was sent or received

-

$FILENM

Replaced with the Send/Receive File Name

$STATUS

Send/Receive Status code

For the status code, refer to Error Codes and Messages.

-

$DETAIL

Send/Receive Detail Code

For the detail code, refer to Error Codes and Messages.

-

$SDATE

Replaced with Send/Receive Start Date (Format: YYMMDD) (*1)

-

$EDATE

Replaced with Send/Receive End Date (Format: YYMMDD) (*1)

-

$STIME

Replaced with Send/Receive Start Time (Format: HHMMSS)

-

$ETIME

Replaced with Send/Receive End Time (Format: HHMMSS)

-

$SDATE2

Replaced with Send/Receive Start Date (Format: YYYYMMDD) (*2)

-

$EDATE2

Replaced with Send/Receive End Date (Format: YYYYMMDD) (*2)

-

$MSG0

Replaced with Message 0

$MSG1

Replaced with Message 1

$MSG2

Replaced with Message 2

$MSG3

Replaced with Message 3

$MSG4

Replaced with Message 4

$MSG5

Replaced with Message 5

$MSGL0

Replaced with Long Message 0

$MSGL1

Replaced with Long Message 1

:

Available

-

:

Not available

*1

:

The format YYMMDD is applied for the order of the year, month, and day in the Post-send Job and the Post-receive Job.

*2

:

The order of the year, month, and day in the Post-send Job and the Post-receive Job reflects the order of the date format specified for Date Format (datefmt) in the System Environment Settings.

Note
  • When Notification (JOBWAIT) in the Receive Management Information is set to 'Successful Job Completion,' HULFT replaces '$EDATE,' '$EDATE2,' and '$ETIME' with the date that the transfer is completed, not with the date that the job is completed.

  • In the following cases, use alphanumeric characters for the character string (such as a file name or a file path) with which HULFT replaces one of the environment variables '$FILENM,' from '$MSG0' to '$MSG5,' or from '$MSGL0' to '$MSGL1.'

    • When the system locale differs between the host on the sending side and the host on the receiving side

    • When HULFT communicates with a version lower than HULFT Ver.8.1

    • When Use HULFT7 Comm. Mode (HUL7MODE) is set to 'Yes'

By specifying the above environment variables as parameters for startup of an application when you specify a startup job in the Job Information, HULFT automatically replaces the environment variables with the values and starts the application.

<Replacement example>

Table 2.2 Example of Replacement

Items

Value

Send Host

HOST0001

File ID

FILEID01

Send Start Date

20141221

Send Start Time

155400

Send End Date

20141221

Send End Time

160232

Send Record Count

12000

Send File Name

d:\hulft\rcv\fileid01.dat

Send Status Code

0

Send Detailed Code

0

<Example of using environment variables in a batch file>

@echo off 
echo %$HOST% %$FILEID% %$SDATE2% %$STIME% %$EDATE2% %$ETIME% 
echo count=%$COUNT% status=%$STATUS% 
if not %$STATUS% == 0 goto end 
echo %$FILENM% 
del %$FILENM% 
:end

<Execution result>

HOST0001 FILEID01 20141221 155400 20141221 160232 
count=12000 status=0 
d:\hulft\rcv\fileid01.dat

<Example of using environment variables in the Job Information>

notepad.exe $FILENM

<Actual startup command>

notepad.exe d:\hulft\rcv\fileid01.dat

(4) Points to be noted for job execution

If the job cannot be executed, check the following points.

Permissions

The job may not start because of the types of permissions. Refer to Operation by users other than Windows system administrator for details about job execution permissions.

Setting of Job Information

Make sure that the setting of the startup job is correct.

Existence of Job Information

Check whether the command described in the startup job exists or not.

Command

Execute the command registered in the Job Information in the command line and check whether the command works or not.

Checking locations of batch files or programs

HULFT does not support the running of a batch file or a program that is located on a network as a HULFT job. Make sure that the batch file or program that is specified as a startup job is located on the local computer.

Note

Because the environment variables '$STARTTRANSFERID' and '$NEWTRANSFERID' are reserved words in HULFT, you cannot include the words in a job. If you include these words, the job will not work.