Chapter Contents |
Previous |
Next |
SAS/AF Software: Class Dictionary |
You can use the SAS Session Event Component by creating an instance of the class and then adding handlers for the events you want to receive. Each event has an associated data argument that provides information specific to the event (such as a library name or catalog entry name).
You can use a SAS session component to listen for the following events:
Event Name | Event Data |
catalog entry created | Character string containing the four-level name of the newly-created catalog, such as 'WORK.MYCAT.NEW.FRAME' |
catalog entry deleted | Character string containing the four-level name of the deleted catalog |
catalog entry renamed | Character string containing the previous four-level name of the renamed entry |
fileref assigned | Character string containing filename and path, such as 'MYFILE d:\myfile' |
fileref deassigned | Character string containing filename and path, such as 'MYFILE' |
library assigned | Character string containing libname, engine, and path of newly created library, such as 'MYLIB V7 d:\mydir' |
library deassigned | Character string containing libname of deassigned library, such as 'MYLIB' |
member created | Character string containing name of newly created library member, such as 'WORK.MYDATA.DATA' |
member deleted | Character string containing name of deleted libary member, such as 'WORK.MYCAT.CATALOG' |
Example
The following example instantiates a SAS session event component to check for library information:
(Adding this component to the Components window allows you to drop the component on a frame.)
When the Add Method dialog appears, click Yes to invoke the New method window. Immediately click OK to end out of the New method window.
onLibraryAssigned: public method libraryInfo:output:char; dcl char libname; dcl num rc; libname=scan(libraryInfo,1,' '); rc=insertc(_self_.items, libname, -1); rc=sortlist(_self_.items); _self_._sendEvent('contents updated'); endmethod; onLibraryDeassigned: public method libraryInfo:output:char; dcl char libname; dcl num rc index; libname=scan(libraryInfo,1,' '); index = searchc(_self_.items, libname); if (index) then do; rc=delitem(_self_.items, index); _self_._sendEvent('contents updated'); end; endmethod;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.