length _method_ $40 dsname $35 wherecls $200 col 8 name $8 type $1 informat format $16; /*****************************************************/ /* METHOD NAME: _INIT_ */ /* GENERAL PURPOSE: Override the _INIT_ method */ /* PARAMETERS PASSED: none */ /*****************************************************/ INIT: method; _method_ = _method_; _self_ = _self_; _frame_ = _frame_; call super(_self_,_method_); modelid=getnitemn(_self_, 'dataid'); call send(modelid,'_SET_INSTANCE_METHOD_', '_GET_ACTIONS_','tools.classes.dtwhere.scl','getact'); endmethod; /**********************************************************/ /* METHOD NAME: _GET_ACTIONS_ */ /* GENERAL PURPOSE: Get the column position. */ /* PARAMETERS PASSED: actions, map, rows, cols - get */ /* column number where pop-up opened.*/ /**********************************************************/ GETACT: method actions map rows cols 8; if (listlen(cols) le 0) then col=0; else col = getitemn(cols,1); call symputn('ACT_COL',col); call super(_self_, _method_,actions,map,rows,cols); endmethod; /**********************************************************/ /* METHOD NAME: _POPUP_ */ /* GENERAL PURPOSE: Add new items to the pop-up menu. */ /* PARAMETERS PASSED: list - the list of pop-up items */ /* sel - item selected in pop-up */ /**********************************************************/ popup: method list sel 8; list = insertc(list, 'Display Column Help',-1); list = insertc(list, 'Specify Subset Criteria',-1); list = insertc(list, 'Clear Subset',-1); call super(_self_, _method_, list, sel); if (sel = 1) then do; col = symgetn('ACT_COL'); if col=0 then do; call send(_self_,'_SET_MSG_', 'You must click within a column to '|| 'display column information.'); return; end; call send(_self_,'_GET_DISPLAYED_COLUMN_NAME_', col,name); collst = makelist(); collst = setnitemc(collst,' ','NAME'); call send(_self_,'_GET_NUMBER_OF_COLUMNS_', numcols); i = 1; collst = setnitemn(collst,i,'COLUMN_NUMBER'); call send(_self_, '_GET_COLUMN_ATTRIBUTES_', collst); do while (i < numcols and name ne getnitemc(collst,'NAME')); i + 1; collst = setnitemn(collst,i,'COLUMN_NUMBER'); call send(_self_, '_GET_COLUMN_ATTRIBUTES_',collst); end; collst = delnitem(collst,'NAME'); call send(_self_,'_GET_COLUMN_ATTRIBUTES_',collst); name = getnitemc(collst,'NAME'); type = getnitemc(collst,'TYPE'); informat = getnitemc(collst,'INFORMAT'); format = getnitemc(collst,'FORMAT'); length = getnitemn(collst,'LENGTH'); wherecls = ' Data Column=' || name || ' Type=' || type || ' Length=' || left(put(length,3.)) || ' Format=' || format || ' Informat=' || informat; call send(_frame_,'_SET_MSG_',wherecls); end; else if (sel = 2) then do; call send(_self_,'_GET_DATASET_NAME_',dsname); whereid=instance (loadclass('sashelp.afclass.where.class')); wval = makelist(); wout = makelist(); call send(whereid,'_EDIT_WHERE_',dsname,wval, wout,1); rc = clearlist(wval); call send(whereid,'_EVAL_WHERE_',wout,wval,rc); if (rc) then call send(_self_,'_SET_WHERE_',wval); rc = dellist(wval); rc = dellist(wout); call send(whereid,'_TERM_'); end; else if (sel = 3) then do; wval = makelist(); wval = setitemc(wval,'CLEAR',1,'Y'); call send(_self_,'_SET_WHERE_',wval); rc=dellist(wval); end; endmethod;