newbe question: convert codepage

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arben Qarkaxhija

    newbe question: convert codepage

    Hello all,

    I'm new to AS400 and we have a problem here with a sql-procedure, that is
    running OK over the Client Access Navigator, but over the 5250 emulator
    hanging with an error "pointer for the given position not set" (anything
    like that I think, I have the error in german and here I mean, I have just
    translated it, but not sure, if the error is shown in english in that way!).

    Here a peace of code:

    1 #include <stdlib.h>
    2 #include <stdio.h>
    3 #include <string.h>
    4 #include <decimal.h>
    5 #include <wcstr.h>
    6 #include <stddef.h>
    7 #include <sqlproc.h>
    8 typedef _Packed struct GETDIAG_RTN_t {
    9 long message_length;
    10 long message_octet_l ength;
    11 char message_text[1025]; };
    ............... ............... .... and so on

    As I said, running this over the Navigator, works probably well. If I run it
    on the 5250 emulator, than I become the error ("pointer for the given
    position von set. Application error. MCH3601 .... on 0000000011, instruction
    X'0000' not audited").

    I think that with the code traslation is sth. wrong. Can you tell me, how
    can I use the function "iconv.h" to traslate the code to 1025?
    I've searched the KB of IBM Developer and found there a sample, but I have
    some problems to use this on our code.

    Help will be appreciated. Thanks a lot in advance for your help.

    Regard from Germany
    Beni




  • Karl Hanson

    #2
    Re: newbe question: convert codepage

    Arben Qarkaxhija wrote:
    [color=blue]
    >
    > I'm new to AS400 and we have a problem here with a sql-procedure, that is
    > running OK over the Client Access Navigator, but over the 5250 emulator
    > hanging with an error "pointer for the given position not set" (anything
    > like that I think, I have the error in german and here I mean, I have just
    > translated it, but not sure, if the error is shown in english in that way!).
    >
    > Here a peace of code:
    >
    > 1 #include <stdlib.h>
    > 2 #include <stdio.h>
    > 3 #include <string.h>
    > 4 #include <decimal.h>
    > 5 #include <wcstr.h>
    > 6 #include <stddef.h>
    > 7 #include <sqlproc.h>
    > 8 typedef _Packed struct GETDIAG_RTN_t {
    > 9 long message_length;
    > 10 long message_octet_l ength;
    > 11 char message_text[1025]; };
    > ............... ............... ... and so on
    >
    > As I said, running this over the Navigator, works probably well. If I run it
    > on the 5250 emulator, than I become the error ("pointer for the given
    > position von set. Application error. MCH3601 .... on 0000000011, instruction
    > X'0000' not audited").
    >
    > I think that with the code traslation is sth. wrong. Can you tell me, how
    > can I use the function "iconv.h" to traslate the code to 1025?
    > I've searched the KB of IBM Developer and found there a sample, but I have
    > some problems to use this on our code.
    >
    > Help will be appreciated. Thanks a lot in advance for your help.
    >
    > Regard from Germany
    > Beni
    >[/color]


    Normally MCH3601 occurs when a program attempts to use a pointer that is
    not set. Try recreating the error, and view the job log of the 5250
    emulator job. If you have a printed job log, find the "To program" for
    the MCH3601 message (exception). If the job is still active, view its
    job log using (for example) WRKJOB option 10, place the cursor on the
    message and press F1 (Help) followed by F9 (Display message details).
    This will also show the "To program" information. This information may
    be useful to determine if your program is causing the exception. If it
    is, you may be able to use a debugger to determine why the pointer is
    not set.

    Re usage of iconv(), here is an example found by searching the InfoCenter:


    Here is another link, to info about Data Conversion APIs:


    --
    Karl Hanson

    Comment

    • Arben Qarkaxhija

      #3
      Re: newbe question: convert codepage

      Hello Karl,

      many thanks for your answer. I'll check this.

      Best regards

      Beni


      Comment

      Working...