"Conversion Error" with open stream file API - IBM AS400

This is a discussion on "Conversion Error" with open stream file API - IBM AS400 ; This sort of falls back to the DBCS issues I'm having with a client. Anyhow, we have physical file containing all text, and a CCSID of 935. One field in the PF of type "O". The text contains some DBCS ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: "Conversion Error" with open stream file API

  1. "Conversion Error" with open stream file API

    This sort of falls back to the DBCS issues I'm having with
    a client.

    Anyhow, we have physical file containing all text, and a
    CCSID of 935. One field in the PF of type "O". The text
    contains some DBCS chinese characters.

    Now, we're trying to read this file and write it to a
    stream file using the IFS APIs.

    For the open API we're specifing a CCSID of 1381.

    But, on the open API call, we're getting a "Conversion
    error" message and the job fails. The error actually shows
    the line number of the error as the definition for the open
    API itself instead of the actual call, though. (odd, I
    thought it would have been on the call).

    Now, we've succesfully taken this PF and copied it to a
    stream file using CPYTOIMPF, and that works fine. We
    specify *STDASCII as the "to" CCSID and it automatically
    creates it as 1381.

    But, we need to use a program to do the conversion to a
    stream file because we do maniuplate some of the data as
    we're going through it.

    This generic "conversion error" is sort of driving me nuts,
    though, as I can't find any information on it except "the
    CCSID is invalid".

    Well, if CPYTOIMPF can do it, shouldn't I be able to?

    Thanks for any assistance with this.

  2. Re: "Conversion Error" with open stream file API

    Bradley,

    Did you already try to use the iconv() API to convert the data and write it to the IFS file as binary
    data (without having O_TEXTDATA specified)?

    Thomas Raddatz.

    Bradley V. Stone schrieb:
    > This sort of falls back to the DBCS issues I'm having with
    > a client.
    >
    > Anyhow, we have physical file containing all text, and a
    > CCSID of 935. One field in the PF of type "O". The text
    > contains some DBCS chinese characters.
    >
    > Now, we're trying to read this file and write it to a
    > stream file using the IFS APIs.
    >
    > For the open API we're specifing a CCSID of 1381.
    >
    > But, on the open API call, we're getting a "Conversion
    > error" message and the job fails. The error actually shows
    > the line number of the error as the definition for the open
    > API itself instead of the actual call, though. (odd, I
    > thought it would have been on the call).
    >
    > Now, we've succesfully taken this PF and copied it to a
    > stream file using CPYTOIMPF, and that works fine. We
    > specify *STDASCII as the "to" CCSID and it automatically
    > creates it as 1381.
    >
    > But, we need to use a program to do the conversion to a
    > stream file because we do maniuplate some of the data as
    > we're going through it.
    >
    > This generic "conversion error" is sort of driving me nuts,
    > though, as I can't find any information on it except "the
    > CCSID is invalid".
    >
    > Well, if CPYTOIMPF can do it, shouldn't I be able to?
    >
    > Thanks for any assistance with this.


  3. Re: "Conversion Error" with open stream file API

    Bradley,

    Did you already try to use the iconv() API to convert the data and write it to the IFS file as binary
    data (without having O_TEXTDATA specified)?

    Thomas Raddatz.

    Bradley V. Stone schrieb:
    > This sort of falls back to the DBCS issues I'm having with
    > a client.
    >
    > Anyhow, we have physical file containing all text, and a
    > CCSID of 935. One field in the PF of type "O". The text
    > contains some DBCS chinese characters.
    >
    > Now, we're trying to read this file and write it to a
    > stream file using the IFS APIs.
    >
    > For the open API we're specifing a CCSID of 1381.
    >
    > But, on the open API call, we're getting a "Conversion
    > error" message and the job fails. The error actually shows
    > the line number of the error as the definition for the open
    > API itself instead of the actual call, though. (odd, I
    > thought it would have been on the call).
    >
    > Now, we've succesfully taken this PF and copied it to a
    > stream file using CPYTOIMPF, and that works fine. We
    > specify *STDASCII as the "to" CCSID and it automatically
    > creates it as 1381.
    >
    > But, we need to use a program to do the conversion to a
    > stream file because we do maniuplate some of the data as
    > we're going through it.
    >
    > This generic "conversion error" is sort of driving me nuts,
    > though, as I can't find any information on it except "the
    > CCSID is invalid".
    >
    > Well, if CPYTOIMPF can do it, shouldn't I be able to?
    >
    > Thanks for any assistance with this.


+ Reply to Thread