From: William M. Klein on
Read the Micro Focus documentation on:

- VRECGEN
and/or
- RDW directive

Both of these relate specially to your "problem" and tell you what is and isn't
supported.

--
Bill Klein
wmklein <at> ix.netcom.com
<pottmi(a)gmail.com> wrote in message
news:1139086819.267599.327500(a)g47g2000cwa.googlegroups.com...
>I have been trying to get a microfocus cobol program to open and read a
> variable sequential file that is the same format as what gets transfer
> to my computer via ftp.
>
> That transfer format is very simple:
> 2 bytes indicating the length of the data.
> 2 bytes of low values
> N bytes of data.
> that pattern repeated for each record.
>
> Microfocus seems to want a 128 byte header on the file, along with some
> other differences.
>
> My questions are:
> 1) has anyone found a combination of options that allow a cobol program
> compiled with the microfocus compiler to read such a file?
> 2) has anyone written an external file handler using microfocus
> sanctioned techniques that will read such a file.
> 3) has anyone written an external file handler using microfocus
> sanctioned techniques that I can have so I can use it as a starting
> point to read such a file.
>
> By MicroFocus sanctioned techniques, I am referring to the microfocus
> "File Handling" book.
>
> Just to save everyone some time...
> I dont need to be told about options like converting the data comma
> delimited files for transfer, and I dont need any information about the
> possibilities of the data not being compatible. My question is about
> sequential file format compatibilty, not data compatiblity. Also, I
> have already written a C program to do the conversion so I already have
> a backup plan if I am not able to read the files directly.
>
> Michael Potter
>


From: pottmi on
Here is how I solved the problem of reading mainframe style ESDS files
with RDWs directly using MicroFocus COBOL:

I wrote a new file handler and used the microfocus compile option
called EXTFH to install my file handler in place of the microfocus File
handler. I wrote it in C because I could reused the routines from my
conversion program to do the reading and writing, but I could have
written it in COBOL.

It was quite straight forward and I consider it a 100% solution to my
problem. It totally eliminated the unnecessary IO.

Another problem that it solved is that now I can declare a file as
fixed record size (normally wo RDW) in MicroFocus COBOL, but maintain
the file on the disk as variable record size (w RDW). We like this
because some of our file manipulation can be generic.

I can not post the code because I was paid to write it. I asked for a
sample from MicroFocus and they quickly replied with sample. I presume
they would extend the same courtesy to licensed user.

--
Michael Potter