Re: EXTFH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Okay we will pull the latest 3.x code and start to test with that. We will be making pretty rigorous use of EXTFH so hopefully I can help debug.  Our VSAM emulation logic is implemented in a EXTFH written in C. 



On Sun, Oct 3, 2021 at 5:50 PM Simon Sobisch <simonsobisch@xxxxxxx> wrote:


Am 03.10.2021 um 21:46 schrieb Michael Potter:
> On this URL:
>
> https://sourceforge.net/projects/gnucobol/files/
> <https://sourceforge.net/projects/gnucobol/files/>
>
> I read this:
>
> ** file handling: include support for a callable EXTFH interface also
> provided by several compilers including Micro Focus This allows users to
> insert an external file handler while retaining all of the normal COBOL
> I/O functions with a possible callback to libcob. To have the compiled
> program call `yourfh()` for file I/O use: `cobc -fcallfh=yourfh` In turn
> `yourfh()` may call `EXTFH()` to use I/O functions from GnuCOBOL. The
> external file handler can also be directly invoked from COBOL, too,
> using `CALL "EXTFH"`. ** Note: Not each flag contained in the FCD3 is
> handled already **

Hi Michael,

yes that URL contains the NEWS file's content - I highly suggest to look
at the specific NEWS file of whatever GnuCOBOL version you use / want to
use.

> Here are my questions:
>
> 1. Does yourfh() accept a single argument which is a FCD3 structure pointer?

No, it accepts the opcode as first and the FCD3 structure pointer as
second argument.
>
> 2. Is there any other documentation on this? Google is not very helpful
> as it is returning answers for other cobol compilers.

EXTFH + FCD3 is actually a 'standard' way for handling file io. What you
find for other compilers should also apply to GnuCOBOL.

Actually, GnuCOBOL was already shown to be usable as EXTFH caller from
both ACUCOBOL-GT and MicroFocus.

In any case I suggest to check tests/testsuite.src/run_files.at for
samples of EXTFH in our testsuite's sources. You find both a "callfh"
example in C (it can also be a COBOL program) under "EXTFH: using ISAM
callback" and a bunch of programs that directly call the 'EXTFH' entry
point to do file io.

> 3. Is there a list of the fields/flags that are not handled?

Not directly, you'd have to check in the sources and map
copy/xfhfcd3.cpy against common.h FCD3 and fileio.c / fextfh.c in libcob
for the fields that are known, their values and especially: their use
(or not).

We recently had a lot of further testing and adjustments, as can also be
seen in the extended entries in the testsuite for this topic, so in any
case: testing EXTFH should use an svn checkout or nightly tarball from
GnuCOBOL (both 3.x and 4.x are nearly identical here). [that said: I
hope to push 3.2rc1 this week, so there will be an "official"
pre-release for wide testing available, too].

The main parts definitely work (organization, min/max record length,
filename, record and key definitions, all COBOL matching opcodes).
Note: as 3.x has much less "info" about the files you need to sometimes
provide "more" information, than for example from MicroFocus (like
specifying at least the number of keys correctly when doing a DELETE
FILE via EXTFH - but that is true in general - also when executing
DELETE FILE from COBOL programs).

Have a nice week,
Simon

[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux