File Status 9/161 when opening a file with CALL 'EXTFH'

[Migrated content. Thread originally posted on 04 February 2011]

In order to bind ISAM data to ADO controls, we have set up a trial project in Visual Cobol R3 that uses the Microfocus File Handler (we also use this in our NetExpress 4.0 projects).
Opening a file with call 'EXTFH' returns a file status 9/161 (something wrong with the file header?).
When running the same code in NetExpress, this returns a file status zero (which is ok).
Does someone know what might be the solution to this problem?
Parents
  • Verified Answer

    Hi Rob,

    I have reviewed the material that you sent to me.

    The problem is that you are defining this in managed code and for managed code the XFHFCD3.cpy file MUST be used.
    The NOFCD3 directive has no bearing upon this.

    In your application you are not copying in the Micro Focus copybook XFHFCD.CPY which will automatically bring in the correct copybook to use, either XFHFCD2.CPY or XFHFCD3.CPY.
    Instead you are bringing in your own copybook named ws-fhndl.cpy which looks to be a hardcoded version of XFHFCD2.CPY but with some of the field names replaced by FILLER.

    In particular the fcd—version-number field does not exist in your copybook.

    What should be defined as:
    05 FCD-LENGTH pic xx comp-x.
    05 FCD-VERSION pic x comp-x.
    78 fcd--version-number value 0.

    Is replaced by:
    *> Reserved. Must be set to binary zeros
    05 filler pic x(03).

    You need to replace your copybook definition of the FCD area with our copybook and modify your program accordingly.
    You will need to add the following statement to your initialization:

    Move fcd—version-number to FCD-VERSION

    So the file handler knows which FCD is being passed to it.

    Thanks.
Reply
  • Verified Answer

    Hi Rob,

    I have reviewed the material that you sent to me.

    The problem is that you are defining this in managed code and for managed code the XFHFCD3.cpy file MUST be used.
    The NOFCD3 directive has no bearing upon this.

    In your application you are not copying in the Micro Focus copybook XFHFCD.CPY which will automatically bring in the correct copybook to use, either XFHFCD2.CPY or XFHFCD3.CPY.
    Instead you are bringing in your own copybook named ws-fhndl.cpy which looks to be a hardcoded version of XFHFCD2.CPY but with some of the field names replaced by FILLER.

    In particular the fcd—version-number field does not exist in your copybook.

    What should be defined as:
    05 FCD-LENGTH pic xx comp-x.
    05 FCD-VERSION pic x comp-x.
    78 fcd--version-number value 0.

    Is replaced by:
    *> Reserved. Must be set to binary zeros
    05 filler pic x(03).

    You need to replace your copybook definition of the FCD area with our copybook and modify your program accordingly.
    You will need to add the following statement to your initialization:

    Move fcd—version-number to FCD-VERSION

    So the file handler knows which FCD is being passed to it.

    Thanks.
Children
No Data