Handling of the receive file
For receive files, the locking method differs depending on the values specified for Receive Mode and Receive Completion Notification in the Receive Management Information.
This section also explains the locking methods used when creating a temporary file, such as in generational management.
When Receive Mode is set to "Single Receive"
In HULFT for zOS
HULFT allocates the receive file in exclusive mode.
When the receive file has already been operated by another Receive job of HULFT, the Receive process either waits until the control of the file is released or ends with an error, depending on the setting for Handling of Receive Files While in Use.
If a non-HULFT job has already operated the receive file in shared mode or in exclusive mode, HULFT retries to access the file, based on the settings for Retry Count for Accessing Receive Files and Retry Interval for Accessing Receive Files. When the HULFT or non-HULFT job releases the control of the file, the file allocation is carried out.
In HULFT for IBMi
For a physical data file
HULFT locks the receive file with the lock status *EXCLRD before opening the file.
When you set Registration Mode to "Replace" or when a request for a resend from checkpoint has been received but the receiving-side transferring from the checkpoint failed, the receive file is temporarily locked with the locking status *EXCL.
If the other HULFT or non-HULFT job has already locked the receive file, HULFT attempt to retry the locking based on the settings for Retry Count on Locked Receive File (RCVLOCKCNT) and Retry Count on Locked Receive File (RCVLOCKTIME).
For a save file
HULFT opens the receive file without locking. In such a case, the locking status of the opened file becomes *SHRNUP.
If another HULFT or non-HULFT job has already locked the receive file, HULFT retries to open the file based on the settings for Retry Count on Locked Receive File and Retry Interval on Locked Receive File.
In HULFT for Linux/AIX
For a local file
HULFT locks the target file with its unique locking mechanism using the actual file name before it opens the receive file. In addition, after opening the receive file, HULFT locks the receive file with the lockf() function. As soon as the file transfer is complete, the receive file is closed (namely, the lock with lockf() function is released).
The release of the file locked by HULFT's unique locking mechanism is made after the various processing (namely, log output, successful job execution, unsuccessful job execution, and CSV Interface operation) is complete.
If another HULFT or non-HULFT process has already locked the receive file, the receiving-side transferring instance waits until the receive file is unlocked or otherwise ends with an error, depending on the setting for Receive Open Mode.
For a network file
HULFT applies the HULFT network file locking before the receive file is opened. In addition, after opening the receive file, HULFT locks the file with the lockf() function. As soon as the file transfer is complete, the receive file is closed (namely, the file lock with the lockf() function is released). The network file lock is released after the various processing (namely, log output, successful job execution, unsuccessful job execution, and CSV Interface operation) is complete. If another HULFT or non-HULFT process has already locked the receive file, the receiving-side transferring instance waits until the receive file is unlocked or otherwise ends with an error, depending on the setting for Receive Open Mode.
You can use network files if HULFT10 Enterprise grade is installed.
In HULFT for Windows
For a local file
After locking the receive file with a mutex object, HULFT opens the file without sharing.
If another HULFT or non-HULFT process has already locked the receive file with a mutex object, the receiving-side transferring instance waits until the receive file is unlocked or otherwise ends with an error, depending on the setting for Receive File Lock Standby.
If a non-HULFT process has already opened the receive file, HULFT opens the file based on the settings of the Retry Count on Locked Receive File and the Retry Interval Count on Locked Receive File.
For a network file
After the receive file is locked with a mutex object, HULFT applies the HULFT network file locking to the file. Then, the file is opened without sharing.
If another HULFT or non-HULFT process has already locked the receive file with a mutex object or the HULFT network file locking, the receiving-side transferring instance waits until the receive file is unlocked or otherwise ends with an error, depending on the setting for Receive File Lock Standby.
If a non-HULFT process has already opened the receive file, HULFT opens the file based on the settings for Retry Count on Locked Receive File and Retry Interval Count on Locked Receive File.
You can use network files if HULFT10 Server grade is installed.
When Receive Mode is set to "Multiple Receive"
In HULFT for zOS
HULFT allocates the receive work file in exclusive mode.
When the receive file has already been operated by another Receive job of HULFT, the receive process either waits until the control of the file is released or ends with an error, depending on the setting for Handling of Receive Files While in Use.
If a non-HULFT job has already operated the receive file in shared mode or in exclusive mode, HULFT retries to access the file, based on the settings for Retry Count for Accessing Receive Files and Retry Count for Accessing Receive Files.
In HULFT for IBMi
For a physical data file
HULFT opens the receive work file without locking it and writes the received data. After the data receiving is complete, HULFT locks the receive file with the lock status as "*EXCLRD " before the file is opened. After HULFT writes appended data in the work file, the application deletes the receive work file.
If another HULFT or non-HULFT job has already locked the receive file, HULFT locks the file based on the settings of Retry Count on Locked Receive File (RCVLOCKCNT) and Retry Interval on Locked Receive File (RCVLOCKTIME).
For a save file
HULFT cannot perform receiving a save file in Multiple Receive mode.
In HULFT for Linux/AIX
For a local file
HULFT locks the receive work file with lockf() function after the file is opened. Then the application writes the received data into the file. After the completion of data receiving, HULFT locks the real file name by using its unique lock before it opens the receive file. In addition, the application locks the file with lockf() function after the file is opened. After locking the file, HULFT writes appended data obtained from the receive work file, then it deletes the receive work file after the completion of writing.
As soon as HULFT terminates transfer, the application closes the receive file (Namely, HULFT releases the lock with lockf() function). HULFT releases its unique lock after the completion of various processing, namely outputting logs, Successful Jobs, Unsuccessful Jobs, or establishing interface with CSV.
If another HULFT or a non-HULFT process has already locked the receive file, the application waits until the file is unlocked, regardless of the setting in the Receive Open Mode.
For a network file
HULFT locks the receive work file with lockf() function after the file is opened. Then the application writes the received data into the file. After the completion of data receiving, HULFT applies HULFT networked file locking before the receive file is opened. In addition, the application locks the file with lockf() function after the file is opened. After locking the file, HULFT writes appended data obtained from the receive work file, then it deletes the receive work file after the completion of writing.
As soon as HULFT terminates transfer, the application closes the receive file (Namely, HULFT releases the lock with lockf() function). HULFT releases the networked file locking after the completion of various processing, namely outputting logs, Successful Jobs, Unsuccessful Jobs, or establishing interface with CSV.
If another HULFT or a non-HULFT process has already locked the receive file, the application waits until the file is unlocked, regardless of the setting in the Receive Open Mode.
You can use network files if HULFT10 Enterprise grade is installed.
In HULFT for Windows
For a local file
HULFT opens the receive work file in not sharing state, without locking it with a mutex object and then writes the received data. After the completion of data receiving, HULFT locks the receive file with a mutex object, opens the file without sharing, and then writes appended data obtained from the work file. After the writing is completed, HULFT deletes the Receive work file.
If another HULFT or a non-HULFT process has already opened the receive work file without sharing, the Receive process ends in error.
In addition, if another HULFT or a non-HULFT process has already locked the receive file with a mutex object, the Receive process either ends with an error or waits until the file is unlocked, depending on the setting for Receive File Lock Standby.
If a non-HULFT process has already opened the receive file, HULFT opens the file based on the settings for Retry Count on Locked Receive File and Retry Interval Count on Locked Receive File.
For a network file
HULFT opens the receive work file without locking it or sharing it and writes the received data into the file. If another HULFT or a non-HULFT process has already opened the receive work file without sharing, the Receive processing ends in error.
After the data is received, HULFT applies the lock with the mutex object to the receive file, and then applies HULFT networked file locking to the file. Then, HULFT opens the file without sharing, and appends data obtained from the receive work file. After the writing is completed, HULFT deletes the Receive work file.
If another HULFT or a non-HULFT process has already locked the receive file, or if the receive file has already been opened, refer to the explanation in When Receive Mode is set to "Single Receive".
You can use network files if HULFT10 Server grade is installed.
When Generational Management is set to "Enabled"
In HULFT for zOS
Same as in When Receive Mode is set to "Single Receive".
However, the file name assigned to exclusive mode must be the one registered in the Receive Management Information, not the one containing the generation file number.
In HULFT for IBMi
For a physical data file
HULFT locks the receive temporary file with the lock status *EXCLRD and writes received data to the file. After the data receiving is complete, HULFT locks the generational management information file with locking status as *SHRUPD and opens the file. HULFT then locks the record in which File IDs are registered and acquires generation file numbers from the generational management information file. After acquiring the generational file number, HULFT unlocks the generational management information file and modify the name of the receive file to the name containing the generation file number. Lastly, HULFT updates the record in which the file ID is registered and unlocks the record to close the generational management information file.
If another HULFT or a non-HULFT job has already locked the receive work file or receive file, HULFT locks the file based on the setting of Retry Count on Locked Receive File and Retry Interval on Locked Receive File.
Also, if another HULFT job or a non-HULFT job has already locked the generational management information file, HULFT locks the file based on the settings for Retry Count on Locked System File and Retry Interval on Locked System File.
For a save file
HULFT opens the file without locking the Receive work file. In such cases, the locking status of the opened file becomes *SHRNUP. After the completion of data receiving, HULFT locks the generational management information file with locking status as *SHRUPD and opens the file. HULFT then locks the record in which File IDs are registered and acquires generation file numbers from the generational management information file. After the acquisition of the generation file numbers, HULFT unlocks the generational management information file and modify the name of the receive file to the name containing the generation file number. Lastly, HULFT updates the record in which the file ID is registered and unlocks the record to close the generational management information file.
If another HULFT or a non-HULFT job has already locked the receive work file or the receive file, HULFT attempt to open the file based on the setting of Retry Count on Locked Receive File and Retry Interval on Locked Receive File.
Also, if another HULFT job or a non-HULFT job has already locked the generational management information file, HULFT locks the file based on the settings for Retry Count on Locked System File and Retry Interval on Locked System File.
In HULFT for Linux/AIX
For a local file
After opening the Receive work file, HULFT locks the work file with lockf() function and writes the received data into the file. After the data receiving is complete, HULFT opens the file at first and then locks the generational management information file by using lockf() function to obtain the generation file number. Then HULFT renames the receive work file into the name containing the generation file number, and unlocks the generational management information file. When the generational management is enabled, HULFT does not use its unique lock mechanism against the actual file name.
If another HULFT or a non-HULFT process has already locked the generational management information file, HULFT waits until it is unlocked.
For a network file
HULFT applies HULFT networked file locking before the receive work file is opened.
In addition, after opening the receive work file, HULFT locks the work file with lockf() function and writes the received data into the file. After the data receiving is complete, HULFT opens the generational management information file at first and then locks the generational management information file by using lockf() to obtain the generation file number. Then HULFT renames the receive work file to a name containing the generation file number, and unlocks the generational management information file.
If another HULFT or a non-HULFT process has already locked the generational management information file, HULFT waits until it is unlocked.
You can use network files if HULFT10 Enterprise grade is installed.
In HULFT for Windows
For a local file
HULFT opens the receive work file in not sharing state, without locking it with a mutex object and then writes the received data. After the data receiving is complete, HULFT obtains the generation file number. Then HULFT renames the receive work file to the name containing the generation file number.
If another HULFT or a non-HULFT process has already opened the receive work file, the Receive process ends with an error.
If another HULFT or a non-HULFT process has already opened the receive file containing the generation file number, the receive processing ends with an error.
For a network file
HULFT applies HULFT networked file locking to the receive work file, and then opens the file without sharing it and writes the received data to the file. After the data receiving is complete, HULFT obtains the generation file number. Then HULFT renames the receive work file to the name containing the generation file number.
If another HULFT or a non-HULFT process has already opened the receive work file without sharing, the Receive processing ends in error.
If another HULFT or a non-HULFT process has already opened the receive file containing the generation file number, the receive processing ends with an error.
If another HULFT or a non-HULFT process has already locked the receive file, or if the receive file has already been opened, refer to the explanation in When Receive Mode is set to "Single Receive".
You can use network files if HULFT10 Server grade is installed.
When Notification is set to "Successful Job Completion"
In HULFT for zOS
Same as in When Receive Mode is set to "Single Receive".
In HULFT for IBMi
For a physical data file
HULFT unlocks the files after the completion of data receiving, where the Notification is set to the 'Receive Completion. ' However, when the field is set to the 'Successful Job Completion,' the file remains in locked status during the Successful Job. HULFT unlocks the file after the completion of the Successful Job.
For a save file
HULFT unlocks the files after the completion of data receiving, regardless of the setting of the Notification.
In HULFT for Linux/AIX
For a local file
If Notification is set to "Receive Completion", HULFT releases its unique locking against the real file name without waiting for the successful job to complete. If the field is set to "Successful Job Completion", HULFT waits for the successful job to complete before releasing the locking.
For a network file
If Notification is set to "Receive Completion", HULFT releases HULFT's networked file locking without waiting for the successful job to complete. If the field is set to "Successful Job Completion", HULFT waits for the successful job to complete before releasing the locking.
You can use network files if HULFT10 Enterprise grade is installed.
In HULFT for Windows
For a local file
If Notification is set to "Receive Completion", HULFT releases the lock with a mutex object after the data receiving is complete. If the field is set to the "Successful Job Completion", HULFT closes the receive file after the data receiving is complete and releases the lock with a mutex object after the successful job is complete.
For a network file
If Notification is set to "Receive Completion", HULFT releases the lock with a mutex object and the networked file locking after the data receiving is complete. If the field is set to "Successful Job Completion", HULFT closes the receive file after the data receiving is complete and releases the lock with a mutex object and the networked file locking after the successful job is complete.
You can use network files if HULFT10 Server grade is installed.