I have unformatted direct access files with a wide range of different record lengths, but when reading the files these are not known in advance. However, the record length is always given as an INTEGER*4 in the first word of the first record of each file.
I try to open the files with RECL=4 (or something similarly small: the record length is always much greater than that), so that I can then close the file and reopen it with the correct record length - but I just get the execution error 108 'Direct access record length mismatch'. I have tried opening files without specifying RECL but then get error 106 'A valid record length must be specified if access is direct'.
Is there any way to open a direct access file without knowing the correct exact record length in advance?