I am attempting to build an indexed file with variable
length records using Dec COBOL v2.2. I get a run-time
error %COB-F-WRITE_SIZE, attempt to write a different
record size on devicename.
My SELECT contains
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
My FD contains
RECORD VARYING 188 TO 302 CHARACTERS
with an 02 level that contains
OCCURS O TO 4 TIMES DEPENDING ON WS-COUNT
Can you tell me what I'm doing wrong.
Many Thanks,
Is each record between 188 and 302 characters?
You probably need (or already have) "0" (Zero) instead of "O"
OCCURS 0 TO 4 TIMES DEPENDING ON WS-COUNT
Also, before your WRITE or REWRITE statements, do
DISPLAY WS-COUNT WITH CONVERSION
and make sure that the value you have for WS-COUNT gives you a complete
record size between 188 and 302 characters.
If you still have a problem with the program, we'll need the entire
source that we can use to duplicate your result.