Thanks for responding.
Actually the COBOL vendor/version is a bit of a sore point with me.
I personally purchased Microfocus Object COBOL V4.0 (for $2000 Australian dollars!) to use on my then NT 3.51 platform. It came with a red security key which had to be plugged into the parallel port to enable it to be used. It was great - no 640K barrier - my working-storage could be bigger, no problems with calling subprograms. Then Microsoft upgraded to NT4.0 and the security key (I presume) wasn't compatible, and I was not able to get an upgraded security key from the company I purchased Object COBOL 4.0 from. The point that makes me sore is that the concept of the security key was an attempt to stop dishonest people, but as is often the case, honsest people get caught up in the war, and end up loosing out!
So anyway, I went back to using Microsoft COBOL V4.5 for DOS, which of course now leaves me in the 21st century, using XP (command line mode) ... and still having a 640K barrier to contend with.
However, I've learnt to live with it.
I actually use a hybrid system of PC & mainframe.
I develop my code on the PC because I can use the Microsoft M.EXE text editor which is nothing short of brilliant because compared to the ISPF editor and any other PC editor I have used, offers fantastic cost savings because of the features it has, and it's ease of use.
Like I presume all programmers have done, I have developed my own code generators and assortment of facilities on the PC to enable me to produce code quicker.
I FTP my code to the mainframe and the rest ... is history.
I've always tried to avoid variable length record files, because I always seemed to have trouble with them.
However, this time, there was no getting out of it.
Anyway I have just got this code to work :-
\code
FD F001-FILE
RECORD IS VARYING IN SIZE
DEPENDING ON WI-F001-RECORD-SIZE
RECORDING MODE IS V.
01 F001-RECORD.
03 F001-TYPE PIC X(04).
etc
WORKING-STORAGE SECTION.
01 WI-F001-RECORD-SIZE PIC 9(04) COMP.
01 WW-F001-RECORD-SIZE PIC 9(04).
\END-CODE
I appreciate your help, as per star!