Problem with put in remote queue (maybe) - Websphere

This is a discussion on Problem with put in remote queue (maybe) - Websphere ; I made a client program that uses the MQOPEN and MQPUT API calls. I then testet it against a remote queue, I got no errors from MQ so I gladly told the people sitting in the server end that our ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Problem with put in remote queue (maybe)

  1. Problem with put in remote queue (maybe)

    I made a client program that uses the MQOPEN and MQPUT API calls.

    I then testet it against a remote queue, I got no errors from MQ so I
    gladly told the people sitting in the server end that our first message
    was send succesfully. Unfortunately they could not see the message.

    So we did a test using a local queue, still no errors from MQ. This
    time it worked perfectly.

    Then I tried to write to the remote queue using the CommerceQuest Queue
    Tool, this also worked perfectly.

    So there's nothing wrong with the client code and nothing wrong in the
    server end, but still the messages disappear in thin air.

    I have two questions:

    1) Does the client software need to know whether it is a local or
    remote queue. I would expect this to be hidden from the client.

    2) Do you have any suggestion on where the message could be, since we
    get no error from MQ series when we put the message


    Here is a snippet of my code (made in Delphi 4)

    begin
    StrCopy( ObjDesc.ObjectName, PChar(MqsWriteQueue) );
    MQOPEN(WriteConnHandle, ObjDesc, MQOO_OUTPUT, WriteQueueHandle,
    comp_code, reason);
    if ( comp_code <> MQCC_OK ) then
    begin
    LogFunc(ThreadName, ModuleName, PChar('failed to open queue.
    (reason = ' + IntToStr(reason) + ')'), LogLevel_ErrorsOnly);
    BreakWriteConnectionToMQS;
    ReadConnectionError := True;
    end
    else
    begin
    StrLCopy(PutMsgDesc.Format, MQFMT_STRING,
    StrLen(MQFMT_STRING));
    buffer_length := strlen( s );
    MQPUT(WriteConnHandle, WriteQueueHandle, PutMsgDesc, PutOptions,
    buffer_length, s, comp_code, reason);
    if ( comp_code <> MQCC_OK ) then
    begin
    LogFunc(ThreadName, ModuleName, PChar('failed to put
    message on queue. (reason = ' + IntToStr(reason) + ')'),
    LogLevel_ErrorsOnly);
    BreakWriteConnectionToMQS;
    ReadConnectionError := True;
    end


  2. Re: Problem with put in remote queue (maybe)

    A QREMOTE is not a physical queue, it actually maps onto a QLOCAL which
    has USAGE(XMITQ). Your MQPUT will work every time, as long as the XMITQ
    is not full.

    The msg will sit on the XMITQ until the channel starts and successfully
    puts the msg to the destination queue. So, your missing message is in
    the XMITQ or possibly the dead letter queue.

    HTH,
    Glenn.

    jah@logimatic.dk wrote:
    > I made a client program that uses the MQOPEN and MQPUT API calls.
    >
    > I then testet it against a remote queue, I got no errors from MQ so I
    > gladly told the people sitting in the server end that our first
    > message was send succesfully. Unfortunately they could not see the
    > message.
    >
    > So we did a test using a local queue, still no errors from MQ. This
    > time it worked perfectly.
    >
    > Then I tried to write to the remote queue using the CommerceQuest
    > Queue Tool, this also worked perfectly.
    >
    > So there's nothing wrong with the client code and nothing wrong in the
    > server end, but still the messages disappear in thin air.
    >
    > I have two questions:
    >
    > 1) Does the client software need to know whether it is a local or
    > remote queue. I would expect this to be hidden from the client.
    >
    > 2) Do you have any suggestion on where the message could be, since we
    > get no error from MQ series when we put the message
    >
    >
    > Here is a snippet of my code (made in Delphi 4)
    >
    > begin
    > StrCopy( ObjDesc.ObjectName, PChar(MqsWriteQueue) );
    > MQOPEN(WriteConnHandle, ObjDesc, MQOO_OUTPUT, WriteQueueHandle,
    > comp_code, reason);
    > if ( comp_code <> MQCC_OK ) then
    > begin
    > LogFunc(ThreadName, ModuleName, PChar('failed to open queue.
    > (reason = ' + IntToStr(reason) + ')'), LogLevel_ErrorsOnly);
    > BreakWriteConnectionToMQS;
    > ReadConnectionError := True;
    > end
    > else
    > begin
    > StrLCopy(PutMsgDesc.Format, MQFMT_STRING,
    > StrLen(MQFMT_STRING));
    > buffer_length := strlen( s );
    > MQPUT(WriteConnHandle, WriteQueueHandle, PutMsgDesc, PutOptions,
    > buffer_length, s, comp_code, reason);
    > if ( comp_code <> MQCC_OK ) then
    > begin
    > LogFunc(ThreadName, ModuleName, PChar('failed to put
    > message on queue. (reason = ' + IntToStr(reason) + ')'),
    > LogLevel_ErrorsOnly);
    > BreakWriteConnectionToMQS;
    > ReadConnectionError := True;
    > end



  3. Re: Problem with put in remote queue (maybe)

    I still have this strange problem. When writing to the remote queue the
    message does not reach the other end of the remote queue.

    When using the test program amqsput.exe everything works as expected,
    but when using my Delphi test program, it only works when writing to a
    local queue.

    I get no errors what so ever from MQ. I hope somebody have an idea on
    how to fix this problem ?

    ----------------------------- Delphi main program
    -----------------------------------------------------

    unit MQSMain;

    interface

    uses Windows, Forms, SysUtils, StdCtrls, Buttons, Controls, Classes,
    ExtCtrls, dialogs, Spin, syncobjs, registry;

    {$I MQS.inc}

    function BreakWriteConnectionToMQS: longint;
    function MakeWriteConnectionToMQS(qm: PChar): longint;
    function SendStringToMQS(s: PChar; qm: PChar; qn: PChar): longint;

    var

    ObjDesc: MQOD = (StrucId: ('O','D',' ',' ');
    Version: MQOD_VERSION_1;
    ObjectType: MQOT_Q;
    ObjectName: '';
    ObjectQMgrName: '';
    DynamicQName: 'AMQ.*';
    AlternateUserId: '';
    RecsPresent: 0;
    KnownDestCount: 0;
    UnknownDestCount: 0;
    InvalidDestCount: 0;
    ObjectRecOffset: 0;
    ResponseRecOffset: 0;
    ObjectRecPtr: nil;
    ResponseRecPtr: nil;
    AlternateSecurityId: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    ResolvedQName: '';
    ResolvedQMgrName: '');

    Filler1: MQMD;

    MsgDesc: MQMD = (StrucId: ('M','D',' ',' ');
    Version: MQMD_VERSION_1;
    Report: MQRO_NONE;
    MsgType: MQMT_DATAGRAM;
    Expiry: MQEI_UNLIMITED;
    Feedback: MQFB_NONE;
    Encoding: MQENC_NATIVE;
    CodedCharSetId: MQCCSI_Q_MGR;
    Format: (' ',' ',' ',' ',' ',' ',' ','
    ');
    Priority: MQPRI_PRIORITY_AS_Q_DEF;
    Persistence: MQPER_PERSISTENCE_AS_Q_DEF;
    MsgId: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    CorrelId: (#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0);
    BackoutCount: 0;
    ReplyToQ: '';
    ReplyToQMgr: '';
    UserIdentifier: '';
    AccountingToken: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    ApplIdentityData: '';
    PutApplType: MQAT_NO_CONTEXT;
    PutApplName: '';
    PutDate: '';
    PutTime: '';
    ApplOriginData: '';
    GroupId: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    MsgSeqNumber: 1;
    Offset: 0;
    MsgFlags: MQMF_NONE;
    OriginalLength: MQOL_UNDEFINED);


    Filler2: MQMD;

    PutOptions: MQPMO = (StrucId: ('P','M','O',' ');
    Version: MQPMO_VERSION_1;
    Options: MQPMO_NONE;
    Timeout: -1;
    Context: 0;
    KnownDestCount: 0;
    UnknownDestCount: 0;
    InvalidDestCount: 0;
    ResolvedQName: '';
    ResolvedQMgrName: '';
    RecsPresent: 0;
    PutMsgRecFields: MQPMRF_NONE;
    PutMsgRecOffset: 0;
    ResponseRecOffset:0;
    PutMsgRecPtr: nil;
    ResponseRecPtr: nil);

    Filler3: MQMD;

    PutMsgDesc: MQMD = (StrucId: ('M','D',' ',' ');
    Version: MQMD_VERSION_1;
    Report: MQRO_NONE;
    MsgType: MQMT_DATAGRAM;
    Expiry: MQEI_UNLIMITED;
    Feedback: MQFB_NONE;
    Encoding: MQENC_NATIVE;
    CodedCharSetId: MQCCSI_Q_MGR;
    Format: (' ',' ',' ',' ',' ',' ',' ','
    ');
    Priority: 0;
    Persistence: MQPER_PERSISTENCE_AS_Q_DEF;
    MsgId: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    CorrelId: (#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0);
    BackoutCount: 0;
    ReplyToQ: '';
    ReplyToQMgr: '';
    UserIdentifier: '';
    AccountingToken: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    ApplIdentityData: '';
    PutApplType: MQAT_NO_CONTEXT;
    PutApplName: '';
    PutDate: '';
    PutTime: '';
    ApplOriginData: '';
    GroupId: (#0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0,
    #0,#0,#0,#0,#0,#0,#0,#0);
    MsgSeqNumber: 1;
    Offset: 0;
    MsgFlags: MQMF_NONE;
    OriginalLength: MQOL_UNDEFINED);

    Filler4: MQMD;

    WriteConnHandle: longint;
    WriteQueueHandle: longint;
    WriteConnectionEstablished: boolean = FALSE;
    WriteConnectionError: boolean = False;

    implementation


    function BreakWriteConnectionToMQS: longint;
    var
    comp_code: longint;
    reason: longint;

    begin
    comp_code := MQCC_OK;
    reason := MQRC_NONE;

    Filler1 := MQMD_DEFAULT;

    if ( WriteConnectionEstablished ) then
    begin
    MQDISC(WriteConnHandle, comp_code, reason);
    if ( comp_code = MQCC_OK ) then
    WriteConnectionEstablished := False
    end
    else
    comp_code := MQCC_OK;

    Result := comp_code;
    end;


    function MakeWriteConnectionToMQS(qm: PChar): longint;
    var
    comp_code: longint;
    reason: longint;

    begin
    comp_code := MQCC_OK;
    reason := MQRC_NONE;
    if ( not WriteConnectionEstablished ) then
    begin
    MQCONN(qm, WriteConnHandle, comp_code, reason);
    if ( comp_code = MQCC_OK ) then
    begin
    WriteConnectionEstablished := True;
    comp_code := MQCC_OK;
    end;
    end;

    Result := reason
    end;

    function SendStringToMQS(s: PChar; qm: PChar; qn: PChar): longint;
    var
    comp_code: longint;
    reason: longint;
    buffer_length: longint;

    begin
    comp_code := MQCC_OK;
    reason := MQRC_NONE;
    if ( WriteConnectionError ) then
    begin
    WriteConnectionError := False;
    end;
    if( not WriteConnectionEstablished ) then
    begin
    comp_code := MakeWriteConnectionToMQS(qm);
    if ( comp_code <> MQCC_OK ) then
    WriteConnectionError := True;
    end;
    if ( comp_code = MQCC_OK ) then
    begin
    StrCopy( ObjDesc.ObjectName, qn);
    MQOPEN(WriteConnHandle, ObjDesc, MQOO_OUTPUT +
    MQOO_FAIL_IF_QUIESCING, WriteQueueHandle, comp_code, reason);
    if ( (comp_code = MQCC_FAILED) or (reason <> MQRC_NONE) ) then
    begin
    WriteConnectionError := True;
    end
    else
    begin

    ShowMessage('Number of open remove queues are: ' +
    IntToStr(objDesc.UnknownDestCount) + ' for queue ' +
    objDesc.ResolvedQName);

    //StrLCopy(PutMsgDesc.Format, MQFMT_STRING,
    StrLen(MQFMT_STRING));
    buffer_length := strlen( s );

    StrLCopy(PutMsgDesc.MsgId, MQMI_NONE_ARRAY,
    StrLen(MQMI_NONE_ARRAY));
    StrLCopy(PutMsgDesc.CorrelId, MQCI_NONE_ARRAY,
    StrLen(MQCI_NONE_ARRAY));

    ShowMessage('Ready to put msg: ' + s + ' with length: ' +
    IntToStr(buffer_length));

    MQPUT(WriteConnHandle, WriteQueueHandle, PutMsgDesc, PutOptions,
    buffer_length, s, comp_code, reason);
    if ( (comp_code <> MQCC_OK) or (reason <> MQRC_NONE) ) then
    begin
    WriteConnectionError := True;
    end
    else
    begin
    MQCLOSE(WriteConnHandle, WriteQueueHandle, MQCO_NONE,
    comp_code, reason);
    if ( comp_code <> MQCC_OK ) then
    begin
    WriteConnectionError := True;
    end;
    end;
    end;
    end;
    Result := reason;
    end;

    end.


    ----------------------------- Delphi include file
    -----------------------------------------------------

    const

    {************************************************* ********************}
    {* Values Related to MQOD Structure
    *}

    {************************************************* ********************}

    {* Structure Identifier *}
    MQOD_STRUC_ID = 'OD ';

    {* Structure Identifier (array form) *}
    MQOD_STRUC_ID_ARRAY: array[0..3] of char = ('O','D',' ',' ');

    {* Structure Version Number *}
    MQOD_VERSION_1 = 1;
    MQOD_VERSION_2 = 2;
    MQOD_VERSION_3 = 3;
    MQOD_CURRENT_VERSION =3;

    {* Structure Length *}
    MQOD_CURRENT_LENGTH = 336;

    {* Object Types *}
    MQOT_Q = 1;
    MQOT_NAMELIST = 2;
    MQOT_PROCESS = 3;
    MQOT_Q_MGR = 5;
    MQOT_CHANNEL = 6;
    MQOT_RESERVED_1 = 7;

    {* Extended Object Types *}
    MQOT_ALL = 1001;
    MQOT_ALIAS_Q = 1002;
    MQOT_MODEL_Q = 1003;
    MQOT_LOCAL_Q = 1004;
    MQOT_REMOTE_Q = 1005;
    MQOT_SENDER_CHANNEL = 1007;
    MQOT_SERVER_CHANNEL = 1008;
    MQOT_REQUESTER_CHANNEL = 1009;
    MQOT_RECEIVER_CHANNEL = 1010;
    MQOT_CURRENT_CHANNEL = 1011;
    MQOT_SAVED_CHANNEL = 1012;
    MQOT_SVRCONN_CHANNEL = 1013;
    MQOT_CLNTCONN_CHANNEL = 1014;

    {* Security Identifier (array form) *}
    MQSID_NONE_ARRAY: array[0..39] of char = '';

    {* Security Identifier Type *}
    MQSIDT_NONE = #0;
    MQSIDT_NT_SECURITY_ID = #1;


    {************************************************* ********************}
    {* Values Related to MQPMO Structure
    *}

    {************************************************* ********************}

    {* Structure Identifier *}
    MQPMO_STRUC_ID = 'PMO ';

    {* Structure Identifier (array form) *}
    MQPMO_STRUC_ID_ARRAY: array[0..3] of char = ('P','M','O',' ');

    {* Structure Version Number *}
    MQPMO_VERSION_1 = 1;
    MQPMO_VERSION_2 = 2;
    MQPMO_CURRENT_VERSION = 2;

    {* Structure Length *}
    MQPMO_CURRENT_LENGTH = 152;

    {* Put-Message Options *}
    MQPMO_SYNCPOINT = $00000002;
    MQPMO_NO_SYNCPOINT = $00000004;
    MQPMO_NEW_MSG_ID = $00000040;
    MQPMO_NEW_CORREL_ID = $00000080;
    MQPMO_LOGICAL_ORDER = $00008000;
    MQPMO_NO_CONTEXT = $00004000;
    MQPMO_DEFAULT_CONTEXT = $00000020;
    MQPMO_PASS_IDENTITY_CONTEXT = $00000100;
    MQPMO_PASS_ALL_CONTEXT = $00000200;
    MQPMO_SET_IDENTITY_CONTEXT = $00000400;
    MQPMO_SET_ALL_CONTEXT = $00000800;
    MQPMO_ALTERNATE_USER_AUTHORITY = $00001000;
    MQPMO_FAIL_IF_QUIESCING = $00002000;
    MQPMO_NONE = $00000000;

    {* Put Message Record Fields *}
    MQPMRF_MSG_ID = 1;
    MQPMRF_CORREL_ID = 2;
    MQPMRF_GROUP_ID = 4;
    MQPMRF_FEEDBACK = 8;
    MQPMRF_ACCOUNTING_TOKEN = 16;
    MQPMRF_NONE = 0;


    {************************************************* ********************}
    {* MQOD Structure -- Object Descriptor
    *}

    {************************************************* ********************}

    type
    MQOD = record
    StrucId: array[0..3] of char; {* Structure
    identifier *}
    Version: longint; {* Structure
    version number *}
    ObjectType: longint; {* Object type
    *}
    ObjectName: array[0..47] of char; {* Object name
    *}
    ObjectQMgrName: array[0..47] of char; {* Object queue
    manager name *}
    DynamicQName: array[0..47] of char; {* Dynamic
    queue name *}
    AlternateUserId: array[0..11] of char; {* Alternate
    user identifier *}
    RecsPresent: longint; {* Number of
    object records present *}
    KnownDestCount: longint; {* Number of
    local queues opened
    successfully
    *}
    UnknownDestCount: longint; {* Number of
    remote queues opened
    successfully
    *}
    InvalidDestCount: longint; {* Number of
    queues that failed to
    open *}
    ObjectRecOffset: longint; {* Offset of
    first object record from
    start of
    MQOD *}
    ResponseRecOffset: longint; {* Offset of
    first response record from
    start of
    MQOD *}
    ObjectRecPtr: pointer; {* Address of
    first object record *}
    ResponseRecPtr: pointer; {* Address of
    first response record *}
    AlternateSecurityId: array[0..39] of char; {* Alternate
    security identifier *}
    ResolvedQName: array[0..47] of char; {* Resolved
    queue name *}
    ResolvedQMgrName: array[0..47] of char; {* Resolved
    queue manager name *}
    end;

    const
    MQOD_DEFAULT: MQOD = (StrucId: ('O','D',' ',' ');
    Version: MQOD_VERSION_1;
    ObjectType: MQOT_Q;
    ObjectName: '';
    ObjectQMgrName: '';
    DynamicQName: 'AMQ.*';
    AlternateUserId: '';
    RecsPresent: 0;
    KnownDestCount: 0;
    UnknownDestCount: 0;
    InvalidDestCount: 0;
    ObjectRecOffset: 0;
    ResponseRecOffset: 0;
    ObjectRecPtr: nil;
    ResponseRecPtr: nil;
    AlternateSecurityId: '';
    ResolvedQName: '';
    ResolvedQMgrName: '')
    ;

    const

    {************************************************* ********************}
    {* Values Related to MQGMO Structure
    *}

    {************************************************* ********************}

    {* Structure Identifier *}
    MQGMO_STRUC_ID = 'GMO ';

    {* Structure Identifier (array form) *}
    MQGMO_STRUC_ID_ARRAY: array[0..3] of char = ('G','M','O',' ');

    {* Structure Version Number *}
    MQGMO_VERSION_1 = 1;
    MQGMO_VERSION_2 = 2;
    MQGMO_VERSION_3 = 3;
    MQGMO_CURRENT_VERSION =3;

    {* Get-Message Options *}
    MQGMO_WAIT = $00000001;
    MQGMO_NO_WAIT = $00000000;
    MQGMO_SYNCPOINT = $00000002;
    MQGMO_SYNCPOINT_IF_PERSISTENT = $00001000;
    MQGMO_NO_SYNCPOINT = $00000004;
    MQGMO_MARK_SKIP_BACKOUT = $00000080;
    MQGMO_BROWSE_FIRST = $00000010;
    MQGMO_BROWSE_NEXT = $00000020;
    MQGMO_BROWSE_MSG_UNDER_CURSOR = $00000800;
    MQGMO_MSG_UNDER_CURSOR = $00000100;
    MQGMO_LOCK = $00000200;
    MQGMO_UNLOCK = $00000400;
    MQGMO_ACCEPT_TRUNCATED_MSG = $00000040;
    MQGMO_SET_SIGNAL = $00000008;
    MQGMO_FAIL_IF_QUIESCING = $00002000;
    MQGMO_CONVERT = $00004000;
    MQGMO_LOGICAL_ORDER = $00008000;
    MQGMO_COMPLETE_MSG = $00010000;
    MQGMO_ALL_MSGS_AVAILABLE = $00020000;
    MQGMO_ALL_SEGMENTS_AVAILABLE = $00040000;
    MQGMO_NONE = $00000000;

    {* Wait Interval *}
    MQWI_UNLIMITED = -1;

    {* Signal Values *}
    MQEC_MSG_ARRIVED = 2;
    MQEC_WAIT_INTERVAL_EXPIRED = 3;
    MQEC_WAIT_CANCELED = 4;
    MQEC_Q_MGR_QUIESCING = 5;
    MQEC_CONNECTION_QUIESCING = 6;

    {* Match Options *}
    MQMO_MATCH_MSG_ID = $00000001;
    MQMO_MATCH_CORREL_ID = $00000002;
    MQMO_MATCH_GROUP_ID = $00000004;
    MQMO_MATCH_MSG_SEQ_NUMBER = $00000008;
    MQMO_MATCH_OFFSET = $00000010;
    MQMO_NONE = $00000000;

    {* Group Status *}
    MQGS_NOT_IN_GROUP = ' ';
    MQGS_MSG_IN_GROUP = 'G';
    MQGS_LAST_MSG_IN_GROUP = 'L';

    {* Segment Status *}
    MQSS_NOT_A_SEGMENT = ' ';
    MQSS_SEGMENT = 'S';
    MQSS_LAST_SEGMENT = 'L';

    {* Segmentation *}
    MQSEG_INHIBITED = ' ';
    MQSEG_ALLOWED = 'A';

    {* Message Token (array form) *}
    MQMTOK_NONE_ARRAY: array[0..15] of char = (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);

    {* Returned Length *}
    MQRL_UNDEFINED = -1;


    {************************************************* ********************}
    {* MQGMO Structure -- Get Message Options
    *}

    {************************************************* ********************}

    type
    MQGMO = record
    StrucId: array[0..3] of char; {* Structure identifier *}
    Version: longint; {* Structure version number *}
    Options: longint; {* Options that control the
    action of
    MQGET *}
    WaitInterval: longint; {* Wait interval *}
    Signal1: longint; {* Signal *}
    Signal2: longint; {* Signal identifier *}
    ResolvedQName: array[0..47] of char; {* Resolved name of
    destination queue *}
    MatchOptions: longint; {* Options controlling
    selection criteria
    used for MQGET *}
    GroupStatus: char; {* Flag indicating whether
    message
    retrieved is in a group *}
    SegmentStatus: char; {* Flag indicating whether
    message
    retrieved is a segment of a
    logical
    message *}
    Segmentation: char; {* Flag indicating whether
    further
    segmentation is allowed for
    the message
    retrieved *}
    Reserved1: char; {* Reserved *}
    MsgToken: array[0..15] of char; {* Message token *}
    ReturnedLength: longint; {* Length of message data
    returned
    (bytes) *}
    end;

    const
    MQGMO_DEFAULT: MQGMO = (StrucId: ('G','M','O',' ');
    Version: MQGMO_VERSION_1;
    Options: MQGMO_NO_WAIT;
    WaitInterval: 0;
    Signal1: 0;
    Signal2: 0;
    ResolvedQName: '';
    MatchOptions:
    MQMO_MATCH_MSG_ID+MQMO_MATCH_CORREL_ID;
    GroupStatus: MQGS_NOT_IN_GROUP;
    SegmentStatus: MQSS_NOT_A_SEGMENT;
    Segmentation: MQSEG_INHIBITED;
    Reserved1: ' ';
    MsgToken: (#0, #0, #0, #0, #0, #0,
    #0, #0,
    #0, #0, #0, #0, #0, #0,
    #0, #0);
    ReturnedLength: MQRL_UNDEFINED)
    ;

    const

    {************************************************* ********************}
    {* Values Related to MQMD Structure
    *}

    {************************************************* ********************}

    {* Structure Identifier *}
    MQMD_STRUC_ID = 'MD ';

    {* Structure Identifier (array form) *}
    MQMD_STRUC_ID_ARRAY: array[0..3] of char = ('M','D',' ',' ');

    {* Structure Version Number *}
    MQMD_VERSION_1 = 1;
    MQMD_VERSION_2 = 2;
    MQMD_CURRENT_VERSION = 2;

    {* Report Options *}
    MQRO_EXCEPTION = $01000000;
    MQRO_EXCEPTION_WITH_DATA = $03000000;
    MQRO_EXCEPTION_WITH_FULL_DATA = $07000000;
    MQRO_EXPIRATION = $00200000;
    MQRO_EXPIRATION_WITH_DATA = $00600000;
    MQRO_EXPIRATION_WITH_FULL_DATA = $00e00000;
    MQRO_COA = $00000100;
    MQRO_COA_WITH_DATA = $00000300;
    MQRO_COA_WITH_FULL_DATA = $00000700;
    MQRO_COD = $00000800;
    MQRO_COD_WITH_DATA = $00001800;
    MQRO_COD_WITH_FULL_DATA = $00003800;
    MQRO_PAN = $00000001;
    MQRO_NAN = $00000002;
    MQRO_NEW_MSG_ID = $00000000;
    MQRO_PASS_MSG_ID = $00000080;
    MQRO_COPY_MSG_ID_TO_CORREL_ID = $00000000;
    MQRO_PASS_CORREL_ID = $00000040;
    MQRO_DEAD_LETTER_Q = $00000000;
    MQRO_DISCARD_MSG = $08000000;
    MQRO_NONE = $00000000;

    {* Report Options Masks *}
    MQRO_REJECT_UNSUP_MASK = $101c0000;
    MQRO_ACCEPT_UNSUP_MASK = $efe000ff;
    MQRO_ACCEPT_UNSUP_IF_XMIT_MASK = $0003ff00;

    {* Message Types *}
    MQMT_SYSTEM_FIRST = 1;
    MQMT_REQUEST = 1;
    MQMT_REPLY = 2;
    MQMT_DATAGRAM = 8;
    MQMT_REPORT = 4;
    MQMT_SYSTEM_LAST = 65535;
    MQMT_APPL_FIRST = 65536;
    MQMT_APPL_LAST = 999999999;

    {* Expiry *}
    MQEI_UNLIMITED = -1;

    {* Feedback Values *}
    MQFB_NONE = 0;
    MQFB_SYSTEM_FIRST = 1;
    MQFB_QUIT = 256;
    MQFB_EXPIRATION = 258;
    MQFB_COA = 259;
    MQFB_COD = 260;
    MQFB_CHANNEL_COMPLETED = 262;
    MQFB_CHANNEL_FAIL_RETRY = 263;
    MQFB_CHANNEL_FAIL = 264;
    MQFB_APPL_CANNOT_BE_STARTED = 265;
    MQFB_TM_ERROR = 266;
    MQFB_APPL_TYPE_ERROR = 267;
    MQFB_STOPPED_BY_MSG_EXIT = 268;
    MQFB_XMIT_Q_MSG_ERROR = 271;
    MQFB_PAN = 275;
    MQFB_NAN = 276;
    MQFB_STOPPED_BY_CHAD_EXIT = 277;
    MQFB_STOPPED_BY_PUBSUB_EXIT = 279;
    MQFB_NOT_A_REPOSITORY_MSG = 280;
    MQFB_DATA_LENGTH_ZERO = 291;
    MQFB_DATA_LENGTH_NEGATIVE = 292;
    MQFB_DATA_LENGTH_TOO_BIG = 293;
    MQFB_BUFFER_OVERFLOW = 294;
    MQFB_LENGTH_OFF_BY_ONE = 295;
    MQFB_IIH_ERROR = 296;
    MQFB_NOT_AUTHORIZED_FOR_IMS = 298;
    MQFB_IMS_ERROR = 300;
    MQFB_IMS_FIRST = 301;
    MQFB_IMS_LAST = 399;
    MQFB_CICS_INTERNAL_ERROR = 401;
    MQFB_CICS_NOT_AUTHORIZED = 402;
    MQFB_CICS_BRIDGE_FAILURE = 403;
    MQFB_CICS_CORREL_ID_ERROR = 404;
    MQFB_CICS_CCSID_ERROR = 405;
    MQFB_CICS_ENCODING_ERROR = 406;
    MQFB_CICS_CIH_ERROR = 407;
    MQFB_CICS_UOW_ERROR = 408;
    MQFB_CICS_COMMAREA_ERROR = 409;
    MQFB_CICS_APPL_NOT_STARTED = 410;
    MQFB_CICS_APPL_ABENDED = 411;
    MQFB_CICS_DLQ_ERROR = 412;
    MQFB_CICS_UOW_BACKED_OUT = 413;
    MQFB_SYSTEM_LAST = 65535;
    MQFB_APPL_FIRST = 65536;
    MQFB_APPL_LAST = 999999999;

    {* Encoding *}
    MQENC_NATIVE = $00000222;

    {* Encoding Masks *}
    MQENC_INTEGER_MASK = $0000000f;
    MQENC_DECIMAL_MASK = $000000f0;
    MQENC_FLOAT_MASK = $00000f00;
    MQENC_RESERVED_MASK = $fffff000;

    {* Encodings for Binary Integers *}
    MQENC_INTEGER_UNDEFINED = $00000000;
    MQENC_INTEGER_NORMAL = $00000001;
    MQENC_INTEGER_REVERSED = $00000002;

    {* Encodings for Packed-Decimal Integers *}
    MQENC_DECIMAL_UNDEFINED = $00000000;
    MQENC_DECIMAL_NORMAL = $00000010;
    MQENC_DECIMAL_REVERSED = $00000020;

    {* Encodings for Floating-Point Numbers *}
    MQENC_FLOAT_UNDEFINED = $00000000;
    MQENC_FLOAT_IEEE_NORMAL = $00000100;
    MQENC_FLOAT_IEEE_REVERSED = $00000200;
    MQENC_FLOAT_S390 = $00000300;

    {* Coded Character-Set Identifiers *}
    MQCCSI_DEFAULT = (0);
    MQCCSI_Q_MGR = (0);
    MQCCSI_INHERIT = (-2);
    MQCCSI_EMBEDDED = (-1);

    {* Formats *}
    MQFMT_NONE = ' ';
    MQFMT_ADMIN = 'MQADMIN ';
    MQFMT_CHANNEL_COMPLETED = 'MQCHCOM ';
    MQFMT_CICS = 'MQCICS ';
    MQFMT_COMMAND_1 = 'MQCMD1 ';
    MQFMT_COMMAND_2 = 'MQCMD2 ';
    MQFMT_DEAD_LETTER_HEADER = 'MQDEAD ';
    MQFMT_DIST_HEADER = 'MQHDIST ';
    MQFMT_EVENT = 'MQEVENT ';
    MQFMT_IMS = 'MQIMS ';
    MQFMT_IMS_VAR_STRING = 'MQIMSVS ';
    MQFMT_MD_EXTENSION = 'MQHMDE ';
    MQFMT_PCF = 'MQPCF ';
    MQFMT_REF_MSG_HEADER = 'MQHREF ';
    MQFMT_RF_HEADER = 'MQHRF ';
    MQFMT_RF_HEADER_2 = 'MQHRF2 ';
    MQFMT_STRING = 'MQSTR ';
    MQFMT_TRIGGER = 'MQTRIG ';
    MQFMT_WORK_INFO_HEADER = 'MQHWIH ';
    MQFMT_XMIT_Q_HEADER = 'MQXMIT ';

    {* Formats (array form) *}
    MQFMT_NONE_ARRAY : array[0..7] of char = (' ',' ',' ','
    ',' ',' ',' ',' ');
    MQFMT_ADMIN_ARRAY : array[0..7] of char =
    ('M','Q','A','D','M','I','N',' ');
    MQFMT_CHANNEL_COMPLETED_ARRAY : array[0..7] of char =
    ('M','Q','C','H','C','O','M',' ');
    MQFMT_CICS_ARRAY : array[0..7] of char =
    ('M','Q','C','I','C','S',' ',' ');
    MQFMT_COMMAND_1_ARRAY : array[0..7] of char =
    ('M','Q','C','M','D','1',' ',' ');
    MQFMT_COMMAND_2_ARRAY : array[0..7] of char =
    ('M','Q','C','M','D','2',' ',' ');
    MQFMT_DEAD_LETTER_HEADER_ARRAY : array[0..7] of char =
    ('M','Q','D','E','A','D',' ',' ');
    MQFMT_DIST_HEADER_ARRAY : array[0..7] of char =
    ('M','Q','H','D','I','S','T',' ');
    MQFMT_EVENT_ARRAY : array[0..7] of char =
    ('M','Q','E','V','E','N','T',' ');
    MQFMT_IMS_ARRAY : array[0..7] of char =
    ('M','Q','I','M','S',' ',' ',' ');
    MQFMT_IMS_VAR_STRING_ARRAY : array[0..7] of char =
    ('M','Q','I','M','S','V','S',' ');
    MQFMT_MD_EXTENSION_ARRAY : array[0..7] of char =
    ('M','Q','H','M','D','E',' ',' ');
    MQFMT_PCF_ARRAY : array[0..7] of char =
    ('M','Q','P','C','F',' ',' ',' ');
    MQFMT_REF_MSG_HEADER_ARRAY : array[0..7] of char =
    ('M','Q','H','R','E','F',' ',' ');
    MQFMT_RF_HEADER_ARRAY : array[0..7] of char =
    ('M','Q','H','R','F',' ',' ',' ');
    MQFMT_RF_HEADER_2_ARRAY : array[0..7] of char =
    ('M','Q','H','R','F','2',' ',' ');
    MQFMT_STRING_ARRAY : array[0..7] of char =
    ('M','Q','S','T','R',' ',' ',' ');
    MQFMT_TRIGGER_ARRAY : array[0..7] of char =
    ('M','Q','T','R','I','G',' ',' ');
    MQFMT_WORK_INFO_HEADER_ARRAY : array[0..7] of char =
    ('M','Q','H','W','I','H',' ',' ');
    MQFMT_XMIT_Q_HEADER_ARRAY : array[0..7] of char =
    ('M','Q','X','M','I','T',' ',' ');

    {* Priority *}
    MQPRI_PRIORITY_AS_Q_DEF = (-1);

    {* Persistence Values *}
    MQPER_NOT_PERSISTENT = 0;
    MQPER_PERSISTENT = 1;
    MQPER_PERSISTENCE_AS_Q_DEF = 2;

    {* Message Identifier (array form) *}
    MQMI_NONE_ARRAY: array[0..23] of char = (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);

    {* Correlation Identifier (array form) *}
    MQCI_NONE_ARRAY: array[0..23] of char = (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);

    {* Accounting Token (array form) *}
    MQACT_NONE_ARRAY: array[0..31] of char = (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);

    {* Accounting Token Type *}
    MQACTT_UNKNOWN = $00;
    MQACTT_CICS_LUOW_ID = $01;
    MQACTT_OS2_DEFAULT = $04;
    MQACTT_DOS_DEFAULT = $05;
    MQACTT_UNIX_NUMERIC_ID = $06;
    MQACTT_OS400_ACCOUNT_TOKEN = $08;
    MQACTT_WINDOWS_DEFAULT = $09;
    MQACTT_NT_SECURITY_ID = $0b;
    MQACTT_USER = $19;

    {* Put Application Types *}
    MQAT_UNKNOWN = (-1);
    MQAT_NO_CONTEXT = 0;
    MQAT_CICS = 1;
    MQAT_MVS = 2;
    MQAT_OS390 = 2;
    MQAT_IMS = 3;
    MQAT_OS2 = 4;
    MQAT_DOS = 5;
    MQAT_AIX = 6;
    MQAT_UNIX = 6;
    MQAT_QMGR = 7;
    MQAT_OS400 = 8;
    MQAT_WINDOWS = 9;
    MQAT_CICS_VSE = 10;
    MQAT_WINDOWS_NT = 11;
    MQAT_VMS = 12;
    MQAT_GUARDIAN = 13;
    MQAT_NSK = 13;
    MQAT_VOS = 14;
    MQAT_IMS_BRIDGE = 19;
    MQAT_XCF = 20;
    MQAT_CICS_BRIDGE = 21;
    MQAT_NOTES_AGENT = 22;
    MQAT_BROKER = 26;
    MQAT_DEFAULT = 11;
    MQAT_USER_FIRST = 65536;
    MQAT_USER_LAST = 999999999;

    {* Group Identifier (array form) *}
    MQGI_NONE_ARRAY: array[0..23] of char = (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);

    {* Message Flags *}
    MQMF_SEGMENTATION_INHIBITED = $00000000;
    MQMF_SEGMENTATION_ALLOWED = $00000001;
    MQMF_MSG_IN_GROUP = $00000008;
    MQMF_LAST_MSG_IN_GROUP = $00000010;
    MQMF_SEGMENT = $00000002;
    MQMF_LAST_SEGMENT = $00000004;
    MQMF_NONE = $00000000;

    {* Message Flags Masks *}
    MQMF_REJECT_UNSUP_MASK = $00000fff;
    MQMF_ACCEPT_UNSUP_MASK = $fff00000;
    MQMF_ACCEPT_UNSUP_IF_XMIT_MASK = $000ff000;

    {* Original Length *}
    MQOL_UNDEFINED = (-1);


    {************************************************* ********************}
    {* MQMD Structure -- Message Descriptor
    *}

    {************************************************* ********************}

    type
    MQMD = record
    StrucId: array[0..3] of char; {* Structure identifier *}
    Version: longint; {* Structure version number
    *}
    Report: longint; {* Options for report
    messages *}
    MsgType: longint; {* Message type *}
    Expiry: longint; {* Message lifetime *}
    Feedback: longint; {* Feedback or reason code
    *}
    Encoding: longint; {* Data encoding *}
    CodedCharSetId: longint; {* Coded character set
    identifier *}
    Format: array[0..7] of char; {* Format name *}
    Priority: longint; {* Message priority *}
    Persistence: longint; {* Message persistence *}
    MsgId: array[0..23] of char; {* Message identifier *}
    CorrelId: array[0..23] of char; {* Correlation identifier
    *}
    BackoutCount: longint; {* Backout counter *}
    ReplyToQ: array[0..47] of char; {* Name of reply queue *}
    ReplyToQMgr: array[0..47] of char; {* Name of reply queue
    manager *}
    UserIdentifier: array[0..11] of char; {* User identifier *}
    AccountingToken: array[0..31] of char; {* Accounting token *}
    ApplIdentityData: array[0..31] of char; {* Application data
    relating to
    identity *}
    PutApplType: longint; {* Type of application that
    put the
    message *}
    PutApplName: array[0..27] of char; {* Name of application that
    put the
    message *}
    PutDate: array[0..7] of char; {* Date when message was
    put *}
    PutTime: array[0..7] of char; {* Time when message was
    put *}
    ApplOriginData: array[0..3] of char; {* Application data
    relating to
    origin *}
    GroupId: array[0..23] of char; {* Group identifier *}
    MsgSeqNumber: longint; {* Sequence number of
    logical message
    within group *}
    Offset: longint; {* Offset of data in
    physical message
    from start of logical
    message *}
    MsgFlags: longint; {* Message flags *}
    OriginalLength: longint; {* Length of original
    message *}
    end;

    const
    MQMD_DEFAULT: MQMD = (StrucId: ('M','D',' ',' ');
    Version: MQMD_VERSION_1;
    Report: MQRO_NONE;
    MsgType: MQMT_DATAGRAM;
    Expiry: MQEI_UNLIMITED;
    Feedback: MQFB_NONE;
    Encoding: MQENC_NATIVE;
    CodedCharSetId: MQCCSI_Q_MGR;
    Format: (' ',' ',' ',' ',' ',' ',' ','
    ');
    Priority: MQPRI_PRIORITY_AS_Q_DEF;
    Persistence: MQPER_PERSISTENCE_AS_Q_DEF;
    MsgId: (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);
    CorrelId: (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);
    BackoutCount: 0;
    ReplyToQ: '';
    ReplyToQMgr: '';
    UserIdentifier: '';
    AccountingToken: (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);
    ApplIdentityData: '';
    PutApplType: MQAT_NO_CONTEXT;
    PutApplName: '';
    PutDate: '';
    PutTime: '';
    ApplOriginData: '';
    GroupId: (#0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0,
    #0, #0, #0, #0, #0, #0, #0,
    #0);
    MsgSeqNumber: 1;
    Offset: 0;
    MsgFlags: MQMF_NONE;
    OriginalLength: MQOL_UNDEFINED)
    ;


    {************************************************* ********************}
    {* MQPMO Structure -- Put Message Options
    *}

    {************************************************* ********************}

    type
    MQPMO = record
    StrucId: array[0..3] of char; {* Structure identifier *}
    Version: longint; {* Structure version number
    *}
    Options: longint; {* Options that control the
    action of
    MQPUT and MQPUT1 *}
    Timeout: longint; {* Reserved *}
    Context: longint; {* Object handle of input
    queue *}
    KnownDestCount: longint; {* Number of messages sent
    successfully
    to local queues *}
    UnknownDestCount: longint; {* Number of messages sent
    successfully
    to remote queues *}
    InvalidDestCount: longint; {* Number of messages that
    could not be
    sent *}
    ResolvedQName: array[0..47] of char; {* Resolved name of
    destination
    queue *}
    ResolvedQMgrName: array[0..47] of char; {* Resolved name of
    destination queue
    manager *}
    RecsPresent: longint; {* Number of put message
    records or
    response records present
    *}
    PutMsgRecFields: longint; {* Flags indicating which
    MQPMR fields
    are present *}
    PutMsgRecOffset: longint; {* Offset of first put
    message record
    from start of MQPMO *}
    ResponseRecOffset:longint; {* Offset of first response
    record from
    start of MQPMO *}
    PutMsgRecPtr: pointer; {* Address of first put
    message
    record *}
    ResponseRecPtr: pointer; {* Address of first response
    record *}
    end;

    const
    MQPMO_DEFAULT: MQPMO = (StrucId: ('P','M','O',' ');
    Version: MQPMO_VERSION_1;
    Options: MQPMO_NONE;
    Timeout: -1;
    Context: 0;
    KnownDestCount: 0;
    UnknownDestCount: 0;
    InvalidDestCount: 0;
    ResolvedQName: '';
    ResolvedQMgrName: '';
    RecsPresent: 0;
    PutMsgRecFields: MQPMRF_NONE;
    PutMsgRecOffset: 0;
    ResponseRecOffset:0;
    PutMsgRecPtr: nil;
    ResponseRecPtr: nil)
    ;

    {* Completion Codes *}
    MQCC_OK = 0;
    MQCC_WARNING = 1;
    MQCC_FAILED = 2;
    MQCC_UNKNOWN = (-1);

    {* Reason Codes *}
    MQRC_NONE = 0;
    MQRC_ALIAS_BASE_Q_TYPE_ERROR = 2001;
    MQRC_ALREADY_CONNECTED = 2002;
    MQRC_BACKED_OUT = 2003;
    MQRC_BUFFER_ERROR = 2004;
    MQRC_BUFFER_LENGTH_ERROR = 2005;
    MQRC_CHAR_ATTR_LENGTH_ERROR = 2006;
    MQRC_CHAR_ATTRS_ERROR = 2007;
    MQRC_CHAR_ATTRS_TOO_SHORT = 2008;
    MQRC_CONNECTION_BROKEN = 2009;
    MQRC_DATA_LENGTH_ERROR = 2010;
    MQRC_DYNAMIC_Q_NAME_ERROR = 2011;
    MQRC_ENVIRONMENT_ERROR = 2012;
    MQRC_EXPIRY_ERROR = 2013;
    MQRC_FEEDBACK_ERROR = 2014;
    MQRC_GET_INHIBITED = 2016;
    MQRC_HANDLE_NOT_AVAILABLE = 2017;
    MQRC_HCONN_ERROR = 2018;
    MQRC_HOBJ_ERROR = 2019;
    MQRC_INHIBIT_VALUE_ERROR = 2020;
    MQRC_INT_ATTR_COUNT_ERROR = 2021;
    MQRC_INT_ATTR_COUNT_TOO_SMALL = 2022;
    MQRC_INT_ATTRS_ARRAY_ERROR = 2023;
    MQRC_SYNCPOINT_LIMIT_REACHED = 2024;
    MQRC_MAX_CONNS_LIMIT_REACHED = 2025;
    MQRC_MD_ERROR = 2026;
    MQRC_MISSING_REPLY_TO_Q = 2027;
    MQRC_MSG_TYPE_ERROR = 2029;
    MQRC_MSG_TOO_BIG_FOR_Q = 2030;
    MQRC_MSG_TOO_BIG_FOR_Q_MGR = 2031;
    MQRC_NO_MSG_AVAILABLE = 2033;
    MQRC_NO_MSG_UNDER_CURSOR = 2034;
    MQRC_NOT_AUTHORIZED = 2035;
    MQRC_NOT_OPEN_FOR_BROWSE = 2036;
    MQRC_NOT_OPEN_FOR_INPUT = 2037;
    MQRC_NOT_OPEN_FOR_INQUIRE = 2038;
    MQRC_NOT_OPEN_FOR_OUTPUT = 2039;
    MQRC_NOT_OPEN_FOR_SET = 2040;
    MQRC_OBJECT_CHANGED = 2041;
    MQRC_OBJECT_IN_USE = 2042;
    MQRC_OBJECT_TYPE_ERROR = 2043;
    MQRC_OD_ERROR = 2044;
    MQRC_OPTION_NOT_VALID_FOR_TYPE = 2045;
    MQRC_OPTIONS_ERROR = 2046;
    MQRC_PERSISTENCE_ERROR = 2047;
    MQRC_PERSISTENT_NOT_ALLOWED = 2048;
    MQRC_PRIORITY_EXCEEDS_MAXIMUM = 2049;
    MQRC_PRIORITY_ERROR = 2050;
    MQRC_PUT_INHIBITED = 2051;
    MQRC_Q_DELETED = 2052;
    MQRC_Q_FULL = 2053;
    MQRC_Q_NOT_EMPTY = 2055;
    MQRC_Q_SPACE_NOT_AVAILABLE = 2056;
    MQRC_Q_TYPE_ERROR = 2057;
    MQRC_Q_MGR_NAME_ERROR = 2058;
    MQRC_Q_MGR_NOT_AVAILABLE = 2059;
    MQRC_REPORT_OPTIONS_ERROR = 2061;
    MQRC_SECOND_MARK_NOT_ALLOWED = 2062;
    MQRC_SECURITY_ERROR = 2063;
    MQRC_SELECTOR_COUNT_ERROR = 2065;
    MQRC_SELECTOR_LIMIT_EXCEEDED = 2066;
    MQRC_SELECTOR_ERROR = 2067;
    MQRC_SELECTOR_NOT_FOR_TYPE = 2068;
    MQRC_SIGNAL_OUTSTANDING = 2069;
    MQRC_SIGNAL_REQUEST_ACCEPTED = 2070;
    MQRC_STORAGE_NOT_AVAILABLE = 2071;
    MQRC_SYNCPOINT_NOT_AVAILABLE = 2072;
    MQRC_TRIGGER_CONTROL_ERROR = 2075;
    MQRC_TRIGGER_DEPTH_ERROR = 2076;
    MQRC_TRIGGER_MSG_PRIORITY_ERR = 2077;
    MQRC_TRIGGER_TYPE_ERROR = 2078;
    MQRC_TRUNCATED_MSG_ACCEPTED = 2079;
    MQRC_TRUNCATED_MSG_FAILED = 2080;
    MQRC_UNKNOWN_ALIAS_BASE_Q = 2082;
    MQRC_UNKNOWN_OBJECT_NAME = 2085;
    MQRC_UNKNOWN_OBJECT_Q_MGR = 2086;
    MQRC_UNKNOWN_REMOTE_Q_MGR = 2087;
    MQRC_WAIT_INTERVAL_ERROR = 2090;
    MQRC_XMIT_Q_TYPE_ERROR = 2091;
    MQRC_XMIT_Q_USAGE_ERROR = 2092;
    MQRC_NOT_OPEN_FOR_PASS_ALL = 2093;
    MQRC_NOT_OPEN_FOR_PASS_IDENT = 2094;
    MQRC_NOT_OPEN_FOR_SET_ALL = 2095;
    MQRC_NOT_OPEN_FOR_SET_IDENT = 2096;
    MQRC_CONTEXT_HANDLE_ERROR = 2097;
    MQRC_CONTEXT_NOT_AVAILABLE = 2098;
    MQRC_SIGNAL1_ERROR = 2099;
    MQRC_OBJECT_ALREADY_EXISTS = 2100;
    MQRC_OBJECT_DAMAGED = 2101;
    MQRC_RESOURCE_PROBLEM = 2102;
    MQRC_ANOTHER_Q_MGR_CONNECTED = 2103;
    MQRC_UNKNOWN_REPORT_OPTION = 2104;
    MQRC_STORAGE_CLASS_ERROR = 2105;
    MQRC_COD_NOT_VALID_FOR_XCF_Q = 2106;
    MQRC_XWAIT_CANCELED = 2107;
    MQRC_XWAIT_ERROR = 2108;
    MQRC_SUPPRESSED_BY_EXIT = 2109;
    MQRC_FORMAT_ERROR = 2110;
    MQRC_SOURCE_CCSID_ERROR = 2111;
    MQRC_SOURCE_INTEGER_ENC_ERROR = 2112;
    MQRC_SOURCE_DECIMAL_ENC_ERROR = 2113;
    MQRC_SOURCE_FLOAT_ENC_ERROR = 2114;
    MQRC_TARGET_CCSID_ERROR = 2115;
    MQRC_TARGET_INTEGER_ENC_ERROR = 2116;
    MQRC_TARGET_DECIMAL_ENC_ERROR = 2117;
    MQRC_TARGET_FLOAT_ENC_ERROR = 2118;
    MQRC_NOT_CONVERTED = 2119;
    MQRC_CONVERTED_MSG_TOO_BIG = 2120;
    MQRC_TRUNCATED = 2120;
    MQRC_NO_EXTERNAL_PARTICIPANTS = 2121;
    MQRC_PARTICIPANT_NOT_AVAILABLE = 2122;
    MQRC_OUTCOME_MIXED = 2123;
    MQRC_OUTCOME_PENDING = 2124;
    MQRC_BRIDGE_STARTED = 2125;
    MQRC_BRIDGE_STOPPED = 2126;
    MQRC_ADAPTER_STORAGE_SHORTAGE = 2127;
    MQRC_UOW_IN_PROGRESS = 2128;
    MQRC_ADAPTER_CONN_LOAD_ERROR = 2129;
    MQRC_ADAPTER_SERV_LOAD_ERROR = 2130;
    MQRC_ADAPTER_DEFS_ERROR = 2131;
    MQRC_ADAPTER_DEFS_LOAD_ERROR = 2132;
    MQRC_ADAPTER_CONV_LOAD_ERROR = 2133;
    MQRC_BO_ERROR = 2134;
    MQRC_DH_ERROR = 2135;
    MQRC_MULTIPLE_REASONS = 2136;
    MQRC_OPEN_FAILED = 2137;
    MQRC_ADAPTER_DISC_LOAD_ERROR = 2138;
    MQRC_CNO_ERROR = 2139;
    MQRC_CICS_WAIT_FAILED = 2140;
    MQRC_DLH_ERROR = 2141;
    MQRC_HEADER_ERROR = 2142;
    MQRC_SOURCE_LENGTH_ERROR = 2143;
    MQRC_TARGET_LENGTH_ERROR = 2144;
    MQRC_SOURCE_BUFFER_ERROR = 2145;
    MQRC_TARGET_BUFFER_ERROR = 2146;
    MQRC_IIH_ERROR = 2148;
    MQRC_PCF_ERROR = 2149;
    MQRC_DBCS_ERROR = 2150;
    MQRC_OBJECT_NAME_ERROR = 2152;
    MQRC_OBJECT_Q_MGR_NAME_ERROR = 2153;
    MQRC_RECS_PRESENT_ERROR = 2154;
    MQRC_OBJECT_RECORDS_ERROR = 2155;
    MQRC_RESPONSE_RECORDS_ERROR = 2156;
    MQRC_ASID_MISMATCH = 2157;
    MQRC_PMO_RECORD_FLAGS_ERROR = 2158;
    MQRC_PUT_MSG_RECORDS_ERROR = 2159;
    MQRC_CONN_ID_IN_USE = 2160;
    MQRC_Q_MGR_QUIESCING = 2161;
    MQRC_Q_MGR_STOPPING = 2162;
    MQRC_DUPLICATE_RECOV_COORD = 2163;
    MQRC_PMO_ERROR = 2173;
    MQRC_API_EXIT_NOT_FOUND = 2182;
    MQRC_API_EXIT_LOAD_ERROR = 2183;
    MQRC_REMOTE_Q_NAME_ERROR = 2184;
    MQRC_INCONSISTENT_PERSISTENCE = 2185;
    MQRC_GMO_ERROR = 2186;
    MQRC_CICS_BRIDGE_RESTRICTION = 2187;
    MQRC_STOPPED_BY_CLUSTER_EXIT = 2188;
    MQRC_CLUSTER_RESOLUTION_ERROR = 2189;
    MQRC_CONVERTED_STRING_TOO_BIG = 2190;
    MQRC_TMC_ERROR = 2191;
    MQRC_PAGESET_FULL = 2192;
    MQRC_PAGESET_ERROR = 2193;
    MQRC_NAME_NOT_VALID_FOR_TYPE = 2194;
    MQRC_UNEXPECTED_ERROR = 2195;
    MQRC_UNKNOWN_XMIT_Q = 2196;
    MQRC_UNKNOWN_DEF_XMIT_Q = 2197;
    MQRC_DEF_XMIT_Q_TYPE_ERROR = 2198;
    MQRC_DEF_XMIT_Q_USAGE_ERROR = 2199;
    MQRC_NAME_IN_USE = 2201;
    MQRC_CONNECTION_QUIESCING = 2202;
    MQRC_CONNECTION_STOPPING = 2203;
    MQRC_ADAPTER_NOT_AVAILABLE = 2204;
    MQRC_MSG_ID_ERROR = 2206;
    MQRC_CORREL_ID_ERROR = 2207;
    MQRC_FILE_SYSTEM_ERROR = 2208;
    MQRC_NO_MSG_LOCKED = 2209;
    MQRC_FILE_NOT_AUDITED = 2216;
    MQRC_CONNECTION_NOT_AUTHORIZED = 2217;
    MQRC_MSG_TOO_BIG_FOR_CHANNEL = 2218;
    MQRC_CALL_IN_PROGRESS = 2219;
    MQRC_RMH_ERROR = 2220;
    MQRC_Q_MGR_ACTIVE = 2222;
    MQRC_Q_MGR_NOT_ACTIVE = 2223;
    MQRC_Q_DEPTH_HIGH = 2224;
    MQRC_Q_DEPTH_LOW = 2225;
    MQRC_Q_SERVICE_INTERVAL_HIGH = 2226;
    MQRC_Q_SERVICE_INTERVAL_OK = 2227;
    MQRC_UNIT_OF_WORK_NOT_STARTED = 2232;
    MQRC_CHANNEL_AUTO_DEF_OK = 2233;
    MQRC_CHANNEL_AUTO_DEF_ERROR = 2234;
    MQRC_CFH_ERROR = 2235;
    MQRC_CFIL_ERROR = 2236;
    MQRC_CFIN_ERROR = 2237;
    MQRC_CFSL_ERROR = 2238;
    MQRC_CFST_ERROR = 2239;
    MQRC_INCOMPLETE_GROUP = 2241;
    MQRC_INCOMPLETE_MSG = 2242;
    MQRC_INCONSISTENT_CCSIDS = 2243;
    MQRC_INCONSISTENT_ENCODINGS = 2244;
    MQRC_INCONSISTENT_UOW = 2245;
    MQRC_INVALID_MSG_UNDER_CURSOR = 2246;
    MQRC_MATCH_OPTIONS_ERROR = 2247;
    MQRC_MDE_ERROR = 2248;
    MQRC_MSG_FLAGS_ERROR = 2249;
    MQRC_MSG_SEQ_NUMBER_ERROR = 2250;
    MQRC_OFFSET_ERROR = 2251;
    MQRC_ORIGINAL_LENGTH_ERROR = 2252;
    MQRC_SEGMENT_LENGTH_ZERO = 2253;
    MQRC_UOW_NOT_AVAILABLE = 2255;
    MQRC_WRONG_GMO_VERSION = 2256;
    MQRC_WRONG_MD_VERSION = 2257;
    MQRC_GROUP_ID_ERROR = 2258;
    MQRC_INCONSISTENT_BROWSE = 2259;
    MQRC_XQH_ERROR = 2260;
    MQRC_SRC_ENV_ERROR = 2261;
    MQRC_SRC_NAME_ERROR = 2262;
    MQRC_DEST_ENV_ERROR = 2263;
    MQRC_DEST_NAME_ERROR = 2264;
    MQRC_TM_ERROR = 2265;
    MQRC_CLUSTER_EXIT_ERROR = 2266;
    MQRC_CLUSTER_EXIT_LOAD_ERROR = 2267;
    MQRC_CLUSTER_PUT_INHIBITED = 2268;
    MQRC_CLUSTER_RESOURCE_ERROR = 2269;
    MQRC_NO_DESTINATIONS_AVAILABLE = 2270;
    MQRC_CONNECTION_ERROR = 2273;
    MQRC_OPTION_ENVIRONMENT_ERROR = 2274;
    MQRC_CD_ERROR = 2277;
    MQRC_CLIENT_CONN_ERROR = 2278;
    MQRC_CHANNEL_STOPPED_BY_USER = 2279;
    MQRC_HCONFIG_ERROR = 2280;
    MQRC_FUNCTION_ERROR = 2281;
    MQRC_CHANNEL_STARTED = 2282;
    MQRC_CHANNEL_STOPPED = 2283;
    MQRC_CHANNEL_CONV_ERROR = 2284;
    MQRC_SERVICE_NOT_AVAILABLE = 2285;
    MQRC_INITIALIZATION_FAILED = 2286;
    MQRC_TERMINATION_FAILED = 2287;
    MQRC_UNKNOWN_Q_NAME = 2288;
    MQRC_SERVICE_ERROR = 2289;
    MQRC_Q_ALREADY_EXISTS = 2290;
    MQRC_USER_ID_NOT_AVAILABLE = 2291;
    MQRC_UNKNOWN_ENTITY = 2292;
    MQRC_UNKNOWN_AUTH_ENTITY = 2293;
    MQRC_UNKNOWN_REF_OBJECT = 2294;
    MQRC_CHANNEL_ACTIVATED = 2295;
    MQRC_CHANNEL_NOT_ACTIVATED = 2296;
    MQRC_UOW_CANCELED = 2297;
    MQRC_SELECTOR_TYPE_ERROR = 2299;
    MQRC_COMMAND_TYPE_ERROR = 2300;
    MQRC_MULTIPLE_INSTANCE_ERROR = 2301;
    MQRC_SYSTEM_ITEM_NOT_ALTERABLE = 2302;
    MQRC_BAG_CONVERSION_ERROR = 2303;
    MQRC_SELECTOR_OUT_OF_RANGE = 2304;
    MQRC_SELECTOR_NOT_UNIQUE = 2305;
    MQRC_INDEX_NOT_PRESENT = 2306;
    MQRC_STRING_ERROR = 2307;
    MQRC_ENCODING_NOT_SUPPORTED = 2308;
    MQRC_SELECTOR_NOT_PRESENT = 2309;
    MQRC_OUT_SELECTOR_ERROR = 2310;
    MQRC_STRING_TRUNCATED = 2311;
    MQRC_SELECTOR_WRONG_TYPE = 2312;
    MQRC_INCONSISTENT_ITEM_TYPE = 2313;
    MQRC_INDEX_ERROR = 2314;
    MQRC_SYSTEM_BAG_NOT_ALTERABLE = 2315;
    MQRC_ITEM_COUNT_ERROR = 2316;
    MQRC_FORMAT_NOT_SUPPORTED = 2317;
    MQRC_SELECTOR_NOT_SUPPORTED = 2318;
    MQRC_ITEM_VALUE_ERROR = 2319;
    MQRC_HBAG_ERROR = 2320;
    MQRC_PARAMETER_MISSING = 2321;
    MQRC_CMD_SERVER_NOT_AVAILABLE = 2322;
    MQRC_STRING_LENGTH_ERROR = 2323;
    MQRC_INQUIRY_COMMAND_ERROR = 2324;
    MQRC_NESTED_BAG_NOT_SUPPORTED = 2325;
    MQRC_BAG_WRONG_TYPE = 2326;
    MQRC_ITEM_TYPE_ERROR = 2327;
    MQRC_SYSTEM_BAG_NOT_DELETABLE = 2328;
    MQRC_SYSTEM_ITEM_NOT_DELETABLE = 2329;
    MQRC_CODED_CHAR_SET_ID_ERROR = 2330;
    MQRC_MSG_TOKEN_ERROR = 2331;
    MQRC_MISSING_WIH = 2332;
    MQRC_WIH_ERROR = 2333;
    MQRC_RFH_ERROR = 2334;
    MQRC_RFH_STRING_ERROR = 2335;
    MQRC_RFH_COMMAND_ERROR = 2336;
    MQRC_RFH_PARM_ERROR = 2337;
    MQRC_RFH_DUPLICATE_PARM = 2338;
    MQRC_RFH_PARM_MISSING = 2339;
    MQRC_APPL_FIRST = 900;
    MQRC_APPL_LAST = 999;


    {************************************************* ********************}
    {* Values Related to MQOPEN Call
    *}

    {************************************************* ********************}

    {* Open Options *}
    MQOO_INPUT_AS_Q_DEF = $00000001;
    MQOO_INPUT_SHARED = $00000002;
    MQOO_INPUT_EXCLUSIVE = $00000004;
    MQOO_BROWSE = $00000008;
    MQOO_OUTPUT = $00000010;
    MQOO_INQUIRE = $00000020;
    MQOO_SET = $00000040;
    MQOO_BIND_ON_OPEN = $00004000;
    MQOO_BIND_NOT_FIXED = $00008000;
    MQOO_BIND_AS_Q_DEF = $00000000;
    MQOO_SAVE_ALL_CONTEXT = $00000080;
    MQOO_PASS_IDENTITY_CONTEXT = $00000100;
    MQOO_PASS_ALL_CONTEXT = $00000200;
    MQOO_SET_IDENTITY_CONTEXT = $00000400;
    MQOO_SET_ALL_CONTEXT = $00000800;
    MQOO_ALTERNATE_USER_AUTHORITY = $00001000;
    MQOO_FAIL_IF_QUIESCING = $00002000;
    MQOO_RESOLVE_NAMES = $00010000;


    {************************************************* ********************}
    {* Values Related to MQCLOSE Call
    *}

    {************************************************* ********************}

    {* Object Handle *}
    MQHO_UNUSABLE_HOBJ = (-1);
    MQHO_NONE = 0;

    {* Close Options *}
    MQCO_NONE = 0;
    MQCO_DELETE = 1;
    MQCO_DELETE_PURGE = 2;


    procedure MQCONN(QMgrName: PChar;
    var Hconn: longint;
    var CompCode: longint;
    var Reason: longint); stdcall;
    external 'MQIC32.DLL' name 'MQCONNstd@16';

    procedure MQDISC(var Hconn: longint;
    var CompCode: longint;
    var Reason: longint); stdcall;
    external 'MQIC32.DLL' name 'MQDISCstd@12';

    procedure MQOPEN(Hconn: longint;
    var ObjDesc: MQOD;
    Options: longint;
    var Hobj: longint;
    var CompCode: longint;
    var Reason: longint); stdcall;
    external 'MQIC32.DLL' name 'MQOPENstd@24';

    procedure MQCLOSE(Hconn: longint;
    var Hobj: longint;
    Options: longint;
    var CompCode: longint;
    var Reason: longint); stdcall;
    external 'MQIC32.DLL' name 'MQCLOSEstd@20';

    procedure MQGET( Hconn: longint;
    Hobj: longint;
    var MsgDesc: MQMD;
    var GetMsgOpts: MQGMO;
    BufferLength: longint;
    Buffer: PChar;
    var DataLength: longint;
    var CompCode: longint;
    var Reason: longint); stdcall;
    external 'MQIC32.DLL' name 'MQGETstd@36';

    procedure MQPUT( Hconn: longint;
    Hobj: longint;
    var MsgDesc: MQMD;
    var PutMsgOpts: MQPMO;
    BufferLength: longint;
    Buffer: PChar;
    var CompCode: longint;
    var Reason: longint); stdcall;
    external 'MQIC32.DLL' name 'MQPUTstd@32';


+ Reply to Thread