Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
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:
Note: The following code is a portion of an SCL program
that is used for illustration purposes only. It is not a complete program.
/******************************************/ /* */ /* 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;
Open a station for the client. | |
Connect to the ADM server. | |
Prepare to check in a specific entry to the ADM server. | |
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. | |
Send the catalog entry to the ADM server. | |
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.