Im from Holland, so i hope my english is good enough. I'm writing a cobol pgm for xml. I'm using 3 files, INPBEST (input), OUTXML (xml) and TEMPFILE (temp file for records i need later).
I'm testing a the moment and when i run 3 customers seperately it goes well concering the TEMPFILE. When i need to fill the TEMPFILE for 2 customers it goes wrong. For the second customer i get EOF right away, but the program does the same sections for the second customer. My code is:
I'm using WS-array and with write i fill the temp records. The SW-OPEN is used to determine if TEMPFILE is open.
IF SW-OPEN = ZERO
OPEN OUTPUT TEMPFILE
MOVE 1 TO SW-OPEN
WRITE TEMP-RECORD FROM TEMP-REC : temp-rec is ws-array
OPEN INPUT TEMPFILE
PERFORM UNTIL EOF
WRITE XML-RECORD FROM TEMP-RECORD
MOVE ZERO TO SW-OPEN
As said for the first en second customer all sections are processed but for second,third etc etc customer EOF is reached (so TEMPFILE is empty). Why is TEMPFILE not filled more than once? Hope you can help me. Thanks.