Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open extent

Status
Not open for further replies.

claudeb

Programmer
Nov 23, 2000
140
CA
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.
 
Hi Claude,

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?

Regards, Jack.
 
Thanks Slade.
What is BTW again ? sorry.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top