SAS 9.1.3 Integration Technologies » Developer's Guide


Common Messaging Interface
Writing Applications Using the Common Interface
Using TIB/Rendezvous with the Common Interface
TIB/Rendezvous Coding Example
TIB/Rendezvous Certified Messaging Coding Examples
Using a Repository with Application Messaging
CALL Routines for the Common Messaging Interface
SETALIAS
SETMAP
SETMODEL
GETALIAS
GETMAP
GETMODEL
GETQUEUEPROPS
DELETEALIAS
DELETEMAP
DELETEMODEL
INIT
TERM
OPENQUEUE
CLOSEQUEUE
SENDMESSAGE
RECEIVEMESSAGE
PARSEMESSAGE
GETATTACHMENT
ACCEPTATTACHMENT
BEGINTRANSACTION
COMMIT
ABORT
FREETRANSACTION
Attachment Layout for Websphere MQ and MSMQ Through Common Messaging Interface
Attachment Layout for TIB/Rendezvous
Attachment Error Handling for Common Messaging Interface
Application Messaging

Using the SAS Registry with the Common Messaging Interface

The SAS registry can be used to store information about objects used for application messaging. This document provides information about using the SAS registry editor to view registry entries. It also provides a sample program for managing registry objects under program control.

Using the SAS Registry Editor

The SAS Registry Editor can be used to verify that values set programmatically for application messaging objects were set properly. To invoke the Registry Editor, from the SAS pull-down menu:

  1. Select Solutions ®
  2. Select Accessories ®
  3. Select Registry Editor ®

The SAS registry has the following hierarchy for application messaging objects:

   Products
     Base
       SAS Messaging
         Transports
           transport1  transportname  MQSeries(trantab=
                                         SAS_trantab_override)
           transport2  transportname  MQSeries-C(trantab=
                                         SAS_trantab_override)
           transport3  transportname  MSMQ
           transport4  transportname  Rendezvous
           transport5  transportname  Rendezvous-CM
         Queues
           queue1      transportname  MQSeries(trantab=
                                         SAS_trantab_override)
                       queuename      QMgr:queue
           queue2      transportname  MSMQ
                       queuename      pathname
           queue3      transportname  Rendezvous
                       queuename      subjectname
         Maps
           map1        descriptor     type,offset,length;
                                         type,offset,length;...
           map2        descriptor     type,offset,length;
                                         type,offset,length;...
         Models
           MSMQ
             model1    authenticate   none,always
                       basepriority   short
                       journal        none,always
                       journalquota   unsigned long
                       label          queue description
                       privlevel      none,body,optional
                       quota          unsigned long
                       transaction    none,always
                       type           binary GUID
           REND
             model2    service        name or port number
                       network        name or identifier
                       daemon         socket number
             model3    cmname         name
                       ledger         filename
                       relayagent     name
                       requestold     yes,no
                       syncledger     yes,no

Writing Applications to Access the SAS Registry

A typical program would configure information such as:

  • Map data descriptor
  • Queue and transport aliases
  • Dynamic model for transport processing.

The following code illustrates how to set and retrieve information within the SAS Registry.

   data _null_;

   length rc 8 msg $ 200;
   length descriptor transport queue label $ 80;
   length type $ 32;
   length auth journal priv trans $ 10;
   length basep journalq quota 8;

   put 'Registry Map creation...';
   call setmap('mymap', 'registry', rc, 
      'char,0,80;double;');
   if rc ne 0 then do;
      put 'Setmap failed';
      msg = sysmsg();
      put msg;
   end;
   else put 'Setmap was successful';

   put 'Registry Map retrieval...';
   call getmap('mymap', 'registry', rc, descriptor);
   if rc ne 0 then do;
      put 'Getmap failed';
      msg = sysmsg();
      put msg;
   end;
   else do;
      put 'Getmap was successful';
      put 'descriptor = ' descriptor;
   end;

   put 'Registry Map deletion...';
   call deletemap('mymap', 'registry', rc);
   if rc ne 0 then do;
      put 'Deletemap failed';
      msg = sysmsg();
      put msg;
   end;
   else put 'Deletemap was successful';

   put '-------------------------------';

   put 'Registry Queue creation...';
   call setalias('queue', 'myqueue', 'registry', 
      rc, 'msmq', 'machine_name\queue_name');
   if rc ne 0 then do;
      put 'Setalias failed';
      msg = sysmsg();
      put msg;
   end;
   else put 'Setalias succeeded';

   put 'Registry Queue retrieval...';
   call getalias('queue', 'myqueue', 'registry', 
      rc, transport, queue);
   if rc ne 0 then do;
      put 'Getalias failed';
      msg = sysmsg();
      put msg;
   end;
   else do;
      put 'Getalias succeeded';
      put 'transport = ' transport;
      put 'queue = ' queue;
   end;

   put '-------------------------------';

   put 'Registry Transport creation...';
   call setalias('transport', 'mytransport', 
      'registry', rc, 'MSMQ');
   if rc ne 0 then do;
      put 'Setalias failed';
      msg = sysmsg();
      put msg;
   end;
   else put 'Setalias succeeded';

   put 'Registry Transport retrieval...';
   call getalias('transport', 'mytransport', 
      'registry', rc, transport);
   if rc ne 0 then do;
      put 'Getalias failed';
      msg = sysmsg();
      put msg;
   end;
   else do;
      put 'Getalias succeeded';
      put 'transport = ' transport;
      put 'queue = ' queue;
   end;

   put '-------------------------------';

   put 'Registry Model creation...';
   call setmodel('msmq', 'mymodel', 'registry', rc,
      'authenticate, label',
      'always', 'Test Queue of MyModel');
   if rc ne 0 then do;
      put 'Setmodel failed';
      msg = sysmsg();
      put msg;
   end;
   else put 'Setmodel succeeded';

   put 'Registry Model retrieval...';
   call getmodel('msmq', 'mymodel', 'registry', rc,
      'authenticate,basepriority,journal,
      journalquota,label,privlevel,quota,
      transaction,type',
      auth, basep, journal, journalq,
      label, priv, quota, trans, type);
   if rc ne 0 then do;
      put 'Getmodel failed';
      msg = sysmsg();
      put msg;
   end;
   else do;
      put 'Getmodel succeeded';
      put 'authenticate = ' auth;
      put 'base priority = ' basep;
      put 'journal = ' journal;
      put 'journal quota = ' journalq;
      put 'label = ' label;
      put 'privacy level = ' priv;
      put 'quota = ' quota;
      put 'transaction = ' trans;
      put 'type = ' type;
   end;

   run;
   quit;