Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Check In a Catalog Entry

The check-in action involves a user sending an entry to the ADM server portion of the application to be merged into the central copy of the catalog. When an entry is checked in, immediate confirmation of the receipt of that entry is needed. Therefore, direct messaging is used for this portion of the application. The result of checking in an entry is for the ADM server to broadcast notification to everyone in the work group so that they can request the updated entries at their convenience. Message queuing is used by the ADM server for the broadcast.

The following code, which was taken from the client portion of the ADM application, allows a user to check in a specified catalog entry. The client program was written to send a message type of 40 to the ADM server program to indicate a catalog entry check in. If the ADM server portion of the application has the catalog entry listed as checked out by this user, it will check in the entry and broadcast a message with a message type of 100. This notifies the users in the work group of the updated entry.

The following variables would be initialized prior to the code fragment:

srvname
supplied to the _open method when opening a client station. This variable contains the service name of the server portion of the ADM application.

uname
supplied to the _send method. This variable contains the userid of the client and will become the first parameter in the message.

incat
used to build the ALIST parameter that is supplied to the _send method. This variable contains the four-level entry name of the private entry to be checked into the central catalogs that are controlled by the server portion of the ADM application.

outcat
supplied to the _send method. This variable contains the four-level entry name of the central copy of the entry that is controlled by the server portion of the ADM application. It is the second parameter in the message.

Note:   The following code is a portion of an SCL program that is used for illustration purposes only. It is not a complete program.  [cautionend]

   /******************************************/
   /*                                        */
   /*       CHECK IN A CATALOG ENTRY         */
   /*                                        */
   /******************************************/

[1]
stationid = loadclass('sashelp.connect.station');
station = instance(stationid);
call send(station, '_open', "TESTPTP", rc);

[2]
cnctionid = loadclass('sashelp.connect.cnction');
cobj = instance(cnctionid);    
call send(cobj, '_open', station, srvname, 
   rc);

[3]
lib = scan(incat,1,'.');
cat = scan(incat,2,'.');
ename = scan(incat,3,'.');
etype = scan(incat,4,'.');
catlist = makelist();

[4]
rc = setnitemc(catlist, "CATALOG", "TYPE");
rc = setnitemc(catlist, cat, "MEMNAME");
rc = setnitemc(catlist, lib, "LIBNAME");
entry = trim(left(ename)) || '.' || 
   trim(left(etype));
rc = setnitemc(catlist, entry, "SELECT");
alist = insertl(alist,catlist,-1); 

[5]
call send(cobj, '_send', 40, 0, alist, rc, 
   uname, outcat);    
if rc ne 0 then 
   put 'send failed';
else do;
   rc=clearlist(alist);

[6]
   call send(cobj, '_query', eventtype, 
      msgtype, 0, alist, rc );
   if rc ne 0 then do;
      str = sysmsg();
      put 'QUERY for response failed' str;
   end;
   call send(cobj, '_recv', rc, str);
   put 'Received message = ' str;
end;

call send(cobj,'_disconnect',rc);
call send(station, '_close', rc);
return;
[1] Open a station for the client.
[2] Connect to the ADM server.
[3] Prepare to check in a specific entry to the ADM server.
[4] The TYPE, MEMNAME, and LIBNAME named items must be set so that the _send will know which catalog to send. The SELECT named item will be used to specify a single entry for the attachment.
[5] Send the catalog entry to the ADM server.
[6] If the ADM server did not accept the client's entry successfully, find out why.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.