UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

amReceiveMsg Syntax amReceiveMsg(hSession,receiverName,policyName, selMsgName, maxMsgLen, dataLen, data, rcvMsgName, reasonCode) Note: This function is case-sensitive. If you want it to be case-insensitive, you must compile your programs using the BASIC command with the -i option. Description 1-90 UniBasic Commands Reference The amReceiveMsg function receives a message sent by the amSendMsg function. For detailed information about amReceiveMsg, see UniBasic Extensions. Parameters The following table describes each parameter of the syntax. Parameter Description hSession The session handle returned by amInitialize. [IN] receiverName The name of a receiver service. If you do not specify a name, UniData uses the system default receiver name. [IN] policyName The name of a policy. If you do not specify a name, UniData uses the system default policy name. [IN] selMsgName Optional parameter specifying the name of a message object containing information (such as a Correl ID) that UniData uses to retrieve the required message fromthe queue. See UniBasic Extensions for detailed information about this parameter. [IN] maxMsgLen The maximum message length the application will accept. Specify as - 1 to accept messages of any length. See UniBasic Extensions for detailed information about this parameter. [IN] amReceiveMsg Parameters

Parameter Description dataLen The length of the retrieved message data, in bytes. Specify ““ (null) if not required. [OUT] data The received message data. [OUT] rcvMsgName The name of a message object for the retrieved message. You can specify ““ (null) for this parameter, in which case UniData uses the system default name (constant AMSD_RCV_MSG). See UniBasic Extensions for detailed information about this parameter. [IN] reasonCode Holds an AMI reason code when the function returns a status indicating an AMI warning or an AMI error occurred. You can use the AMI reason code to obtain more information about the cause of the warning or error. See the MQSeries Application Messaging Interface manual for a list of AMI reason codes and their descriptions. [OUT] The following table describes the status of each return code. Return Code Status amReceiveMsg Parameters (continued) 0 – AMCC_SUCCESS Function complete successfully. 1 – AMCC_WARNING A warning was returned from AMI. The reasonCode output parameter contains an AMI reason code with further details about the warning. 2 – AMCC_FAILED An error was returned from AMI. The reasonCode output parameter contains an AMI reason code with further details about the error. Other A non-AMI error occurred. amReceiveMsg Return Codes amReceiveMsg 1-91

Parameter Description<br />

dataLen The length of the retrieved message data, in bytes. Specify ““ (null) if<br />

not required. [OUT]<br />

data The received message data. [OUT]<br />

rcvMsgName The name of a message object for the retrieved message. You can<br />

specify ““ (null) for this parameter, in which case UniData uses the<br />

system default name (constant AMSD_RCV_MSG). See <strong>UniBasic</strong><br />

Extensions for detailed information about this parameter. [IN]<br />

reasonCode Holds an AMI reason code when the function returns a status indicating<br />

an AMI warning or an AMI error occurred. You can use the AMI reason<br />

code to obtain more information about the cause of the warning or error.<br />

See the MQSeries Application Messaging Interface manual for a list of<br />

AMI reason codes and their descriptions. [OUT]<br />

The following table describes the status of each return code.<br />

Return Code Status<br />

amReceiveMsg Parameters (continued)<br />

0 – AMCC_SUCCESS Function complete successfully.<br />

1 – AMCC_WARNING A warning was returned from AMI. The reasonCode output<br />

parameter contains an AMI reason code with further details<br />

about the warning.<br />

2 – AMCC_FAILED An error was returned from AMI. The reasonCode output<br />

parameter contains an AMI reason code with further details<br />

about the error.<br />

Other A non-AMI error occurred.<br />

amReceiveMsg Return Codes<br />

amReceiveMsg 1-91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!