Hello,
Could you please tell me why i can't do a simple open-extent on an empty file (ESDS). When i fill my file with old records, i have no abend !
Thanks.
PS: the problem is solved but i would like to know why.
I assume you mean OPEN EXTEND. The following was taken from the COBOL Programming Guide, Document Number: SC26-9049-05.
Quote:
1.9.3.2.1 Opening an empty file
To open a file that has never contained records (an empty file), use the following statements depending on the
type of file:
OPEN OUTPUT for ESDS files.
OPEN OUTPUT or OPEN EXTEND for KSDS and RRDS files. (Either coding has the same effect.) If you have coded the file for random or dynamic access and the file is optional, you can use OPEN I-O.
end quote
It seems you can only use o/p if there's no data in the file. I assume you're using file-status for the i/o stmts. Check the fs after open extend; if bad open, open it again w/output. That should do it for you. BTW, how did you fix it?
1/ copied the file to a new file B
2/ delete-define of the same file with larger cylinders (from 25 to 50)
3/ copied B to my new file. (32000+) records
4/ re-run the program
it seems to me that it is a waste of space, but i don't know if we will need all the records in the future. i don't want to be responsible for the loss.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.