Last record appears twice in the dataset; COBOL; MAINFRAME


I've got this issue while playing with some COBOL codes, I couldn't really find why it's happening for a while. I tried googling and I came across posts which suggested it must be a logical error!!! something like wrong logic used while processing EOF etc. But this was not my case, I put write statements to write one record and it's appearing twice!! When I tried writing two records 3 in total appeared in the output dataset.

So what was the issue??!! I didn't close the file!! (and of course I had a close file statement which was preceded by a ton of conditional statements, my bad ;)) that was it!!!.... I wasted my half an hour googling for the answer, but I didn't try putting a display statement after the close!!! Grrrrrrrrrr
0 Responses to "Last record appears twice in the dataset; COBOL; MAINFRAME"

Post a Comment