‎2008 Nov 09 6:24 PM
Hi
Has anyone come into a situation where he had to do an inbound interface
(i.e using open dataset by scanning all the file in AL11)
how do you treat program running in parallel in this situation.
what i mean is that if the same program is doing an open dataset and treating the same file in al11. Then inconsistencies may occur
is there a way to lock a program that is running that is triggering an error message "
‎2008 Nov 10 3:05 AM
Hi,
I too faced a similar situation and this is what I implemented.
Whenever your programs starts processing a particular AL11 File, Create a New Flag File in the Same Directory.
Say if my file name is usr\bin\ABC.DAT, before OPEN DATASET command on this file, I would create a new file usr\bin\ABC.DAT.FLAG!!!.
After the processing ABC.DAT is done, I delete the Flag File.
In the mean time, If some other program, (or for that matter the same program) executes in a different session and tries to open the same file, we can check for the existence of the FLAG FILE.
So the code is as follows.
CHECK for the Existence of FLAG FILE.
If FLAG FILE Exists, STOP. " another session is processing it.
ELSE.
CREATE FLAG FILE.
OPEN DATASET, and rest others.
CLOSE DATASET.
ENDIF.
Hope this helps.
Thanks,
Surya
‎2008 Nov 09 6:27 PM
‎2008 Nov 10 3:05 AM
Hi,
I too faced a similar situation and this is what I implemented.
Whenever your programs starts processing a particular AL11 File, Create a New Flag File in the Same Directory.
Say if my file name is usr\bin\ABC.DAT, before OPEN DATASET command on this file, I would create a new file usr\bin\ABC.DAT.FLAG!!!.
After the processing ABC.DAT is done, I delete the Flag File.
In the mean time, If some other program, (or for that matter the same program) executes in a different session and tries to open the same file, we can check for the existence of the FLAG FILE.
So the code is as follows.
CHECK for the Existence of FLAG FILE.
If FLAG FILE Exists, STOP. " another session is processing it.
ELSE.
CREATE FLAG FILE.
OPEN DATASET, and rest others.
CLOSE DATASET.
ENDIF.
Hope this helps.
Thanks,
Surya