Kbase P63450: Batch process hangs when importing text file
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  20/01/2004 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.1D
SYMPTOM(s):
Batch process hangs when importing text file
CAUSE:
The batch process has nested REPEAT blocks and is reading a text file using the IMPORT UNFORMATTED statement. The code uses the NO-ERROR phrase on the IMPORT statement then checks for ERROR-STATUS:ERROR being true or for the variable the data was imported to to be an empty string and if either condition is true then both repeat block are exited. Unfortunately, when end of file is hit the NO-ERROR phrase on the IMPORT statement does not suppress the error condition so that the IF statement can cause the exit of both REPEAT blocks.
FIX:
Modify the source code to use the ON ... UNDO, RETRY option of the REPEAT statement. Sample code is shown below:
INPUT FROM VALUE (SomeFile).
REPEAT TRANSACTION ON ERROR UNDO, RETRY ON STOP UNDO, RETRY
ON ENDKEY UNDO, RETRY ON QUIT UNDO, RETRY:
IF RETRY THEN
LEAVE. /* You can add a do/end block here to do more processing */
IMPORT UNFORMATTED SomeCharacterVariable.
END.
INPUT CLOSE.