Valid syntax

Your input file for the utility must conform to the C language syntax.

If we are unfamiliar with C, refer to the C example in this topic.

In addition, be aware of the following rules:

  • typedef is recognized only before the struct keyword.
  • A structure tag is required on your structure declarations.
  • We can use empty square brackets [ ] to denote a variable length array or string at the end of a message.
  • Multidimensional arrays and arrays of strings are not supported.
  • The following additional data types are recognized:

    • MQBOOL
    • MQBYTE
    • MQCHAR
    • MQFLOAT32
    • MQFLOAT64
    • MQSHORT
    • MQLONG
    • MQINT8
    • MQUINT8
    • MQINT16
    • MQUINT16
    • MQINT32
    • MQUINT32
    • MQINT64
    • MQUINT64

    MQCHAR fields are code page converted, but MQBYTE, MQINT8 and MQUINT8 are left untouched. If the encoding is different, MQSHORT, MQLONG, MQINT16, MQUINT16, MQINT32, MQUINT32, MQINT64, MQUINT64, MQFLOAT32, MQFLOAT64 and MQBOOL are converted accordingly.

  • Do not use the following types of data:

    • double
    • pointers
    • bit-fields

    This is because the utility for creating conversion-exit code does not provide the facility to convert these data types. To overcome this, we can write your own routines and call them from the exit.

Other points to note:

  • Do not use sequence numbers in the input data set.
  • If there are fields for which we want to provide your own conversion routines, declare them as MQBYTE, and then replace the generated CMQXCFBA macros with your own conversion code.


C example

  struct TEST { MQLONG    SERIAL_NUMBER;
                MQCHAR    ID[5];
                MQINT16   VERSION;
                MQBYTE    CODE[4];
                MQLONG    DIMENSIONS[3];
                MQCHAR    NAME[24];
              } ;

This corresponds to the following declarations in other programming languages:


COBOL

       10 TEST.
        15 SERIAL-NUMBER  PIC S9(9) BINARY.
        15 ID             PIC X(5).
        15 VERSION        PIC S9(4) BINARY.
      * CODE IS NOT TO BE CONVERTED
        15 CODE           PIC X(4).
        15 DIMENSIONS     PIC S9(9) BINARY OCCURS 3 TIMES.
        15 NAME           PIC X(24).


System/390

TEST           EQU *
SERIAL_NUMBER  DS  F
ID             DS  CL5
VERSION        DS  H
CODE           DS  XL4
DIMENSIONS     DS  3F
NAME           DS  CL24


PL/I

Supported on z/OS only
 DCL 1 TEST,
       2 SERIAL_NUMBER  FIXED BIN(31),
       2 ID             CHAR(5),
       2 VERSION        FIXED BIN(15),
       2 CODE           CHAR(4),        /* not to be converted */
       2 DIMENSIONS(3)  FIXED BIN(31),
       2 NAME           CHAR(24);
Parent topic: Data-conversion exit reference