Why when I run my code in Cobol, the error is appear but it say nothing?

107 Views Asked by At

I have couple errors when I test my code with Cobol:
1: car1.cbl:44: libcob: READ/START not allowed (STATUS = 47) File : 'D:\cobol\CARFILE.TXT'
2: you can see the error but it show nothing

I think maybe because of my app so I tried to reinstall and when i run the same code it show error like the picture. Please help. thanks

1

There are 1 best solutions below

0
Rick Smith On

STATUS = 47 means that a file operation was attempted after the file was closed. In this case, a READ statement.

After the first READ, the file is closed at line 57. The next READ causes the error.

Remove the CLOSE statement at line 57.

        CLOSE CAR-FILE-IN.

This will keep the file open until end-of-file. The file will be closed by the CLOSE statement at line 36.