Application Messaging
Writing Applications Using the Common Messaging InterfaceTwo general types of programs can use the common messaging interface. One uses the interface to administer information about the message transports. Another uses the interface to send and receive messages between applications. These two types of programs are discussed in the sections below. Important Note: In Version 9 of the Common Messaging Interface, Version 9 enhanced data sets are the default format for sending and receiving data sets. In order to send and receive Version 8 data sets, you must include the "ATTACH_VERSION=VERSION_8" option in the Dataset option list on the SENDMESSAGE call. If you do not use the "ATTACH_VERSION=VERSION_8" option on the SENDMESSAGE call, received data sets will be stored in the Version 9 format. If you might be sending data sets to another SAS session that is running Release 8.2 or earlier, use this option to exchange data sets in a format that can be interpreted by both applications. Administrator ProgramsSAS programs can utilize the common messaging interface in order to administer the information in the repository for the queues. The goal of such an administrator program is to encapsulate all information about the queues so that all other programs in the application can focus on using the queues rather than configuring them. This not only simplifies the other programs, but also makes the queues easier to administer by having all of this information in one location. An administrator program performs general functions. For example:
The following SAS CALL routines are used to administer the information repository: Other functions of the administration process include removing any unneeded information in the repository. This encompasses functions such as the following:
The following SAS CALL routines are used to administer these aspects of the information repository: User ProgramsThis section describes how a SAS program can use the common messaging interface in order to access message queues to send and receive messages to other programs. The common interface alleviates the need for these user programs to use transport-specific code. This makes the user programs less vulnerable to changes in the queue's attributes. The programs interact with each queue in a consistent matter, independent of the transport. User programs perform general functions such as the following:
The following SAS CALL routines are the basis for initializing/terminating a transport, opening/closing a queue, and sending/receiving messages and attachments:
In addition, user programs can perform transaction processing on transaction queues. Such functions include the following:
The following SAS CALL routines are provided for applications that require transaction processing: |