/* REXX LISTUSR TBDISPL table ULIST Use '(routine name) ?' for HELP-text. |**-***-***-***-***-***-***-***-***-***-***-***-***-***-***-***-**| | | | WARNING: EMBEDDED COMPONENTS. | | See text following TOOLKIT_INIT | | | |**-***-***-***-***-***-***-***-***-***-***-***-***-***-***-***-**| Written by Chris Lewis 950720 Rewritten by Frank Clarke 20010321 Rewritten by Frank Clarke 20230112 Impact Analysis . SYSEXEC DFLTTLIB . SYSEXEC FCCMDUPD . SYSEXEC TBLGEN . SYSEXEC TBREPRO . SYSEXEC TRAPOUT . SYSEXEC WHOSON Modification History 20010321 fxc Major rewrite 20010615 fxc add user names 20010718 fxc block PFSHOW 20020104 fxc WIDEHELP; updated HELP text; 20020128 fxc use FCCMDUPD instead of much internal code; 20200203 fxc made callable from READY 20230118 fxc change options on main panel; rig for SU-type table 20230124 fxc update HELP-text 20230206 fxc TBREPRO table USER to @TMP and add field ONINDIC; trap the output of WHOSON and mark each row to indicate users presently logged on. 20230309 fxc use fields from table @TMP for SEND; translate any single quotes in text to dots; 20230324 fxc clearly delineate between tables USER and @TMP; 20230415 fxc fix BDPS_; adjust HELP; 20230529 fxc RC=4 from TBCREATE is OK; 20230613 fxc add DEL to DEIMBED ALLOC 20230806 fxc chg SYSPROC to SYSEXEC in Impact Analysis; 20230911 fxc use ZUP/ZCONT in HELP panels; 20240213 fxc use DFLTTLIB to locate USER table; 20240222 fxc added logging; 20240229 fxc remove imbeds from I/A; 20240305 fxc align panel names; 20240308 fxc chg dollar-sign to @ everywhere; 20240318 fxc log nowon; 20240404 fxc changed tutorial to scrollable area; 20240607 fxc added panel SENDH1 */ arg argline address ISPEXEC /* REXXSKEL ver.19991109 */ arg parms "((" opts signal on syntax signal on novalue call TOOLKIT_INIT /* conventional start-up -*/ rc = trace(tv) info = parms /* to enable parsing */ if sw.inispf = "0" then do arg line line = line "(( RESTARTED" /* tell the next invocation */ address TSO "ISPSTART CMD("exec_name line")" /* Invoke ISPF if nec. */ exit 2 /* bail out */ end call A_INIT /* Initialization -*/ if \sw.0error_found then, call B_TABLE_OPS /* ISPF functions -*/ if sw.0SaveLog then, call ZB_SAVELOG /* -*/ if sw.0restarted then do /* at end of mainline */ rc = OutTrap("ll.") exit 4 end exit /*@ LISTUSR */ /* . ----------------------------------------------------------------- */ A_INIT: /*@ */ if branch then call BRANCH address TSO call A0_SETUP_LOG /* -*/ logpref = "("Branch("ID")")" call ZL_LOGMSG( logpref "ISPTLIB =" isptlib ) call ZL_LOGMSG( logpref "ISPTABL =" isptabl ) call ZL_LOGMSG( logpref " Table =" @tn@ ) lower = "'- abcdefghijklmnopqrstuvwxyz" push lower ; pull upper uname. = "" parse value "'3f3f'x " with, x3f3f fn. mi. ln. parse value "0 0 0 0 0 0 0" with, ct. . openmode.0 = "WRITE" /* based on NOUPDT */ openmode.1 = "NOWRITE" allnames = Space(, "SUUSER SUNAME SUFN SUMN SULN SUOWNER", "SUCREDT SULOGDT SUATTR SUDATA ONINDIC",1 ) return /*@ A_INIT */ /* . ----------------------------------------------------------------- */ A0_SETUP_LOG: /*@ */ if branch then call BRANCH address TSO msglim = SYSVAR( "SYSWTERM" ) - 12 parse value "0 0 0 0 0" with, log# log. . parse value Date("S") Time("S") Time("N") with, yyyymmdd sssss hhmmss . hhmmss = Space( Translate( hhmmss,' ',':' ) ,0 ) parse var yyyymmdd 4 yrdigit 5 mm 7 dd /* 9 12 14 maybe */ if Pos(yrdigit,"13579") > 0 then mm = mm + 12 /* mm=24 */ logtag = Substr("ABCDEFGHIJKLMNOPQRSTUVWX",mm,1) /* logtag=X */ subid = logtag""dd""Left( hhmmss,4 ) /* X141743 ? */ vb255.0 = "NEW CATALOG UNIT(SYSDA) SPACE(1 5) TRACKS", "RECFM( V B ) LRECL( 255 ) BLKSIZE( 0 )" vb255.1 = "SHR" /* if it already exists... */ logdsn = "@LOG."exec_name"."subid".LIST" logpref = "("Branch("ID")")" call ZL_LOGMSG( exec_name "started by" Userid() yyyymmdd hhmmss ) call ZL_LOGMSG( logpref "Arg:" argline ) return /*@ A0_SETUP_LOG */ /* . ----------------------------------------------------------------- */ B_TABLE_OPS: /*@ */ if branch then call BRANCH address ISPEXEC "CONTROL ERRORS RETURN" /* I'll handle my own */ call BA_OPEN_TABLE /* open input -*/ call BB_REPRO /* make a copy in VIO -*/ call BC_ANNOTATE /* mark who's logged on -*/ call BD_DISPLAY_TABLE /* show the table -*/ call BZ_DROP_TABLE /* flush -*/ return /*@ B_TABLE_OPS */ /* Table USER lists all known users whether logged on or not. Its shape is: KEYS( SUUSER ) NAMES( SUNAME SUFN SUMN SULN SUOWNER SUCREDT SULOGDT SUATTR SUDATA ) . ----------------------------------------------------------------- */ BA_OPEN_TABLE: /*@ open input table */ if branch then call BRANCH address ISPEXEC "LIBDEF ISPTLIB DATASET ID("isptlib") STACK" "TBSTATS" @tn@ "STATUS1(s1) STATUS2(s2)" if s1 > 1 then do zerrsm = "Table" @tn@ "not available." say zerrsm zerrlm = "Table" @tn@ "not found in the ISPTLIB library chain" "SETMSG MSG(ISRZ002)" sw.0error_found = "1"; return end; else, if s2 = 1 then do /* table is not open */ "TBOPEN " @tn@ "NOWRITE" if rc > 4 then do sw.0error_found = 1 zerrsm = "Table did not OPEN" zerrlm = "Table" @tn@ "cannot be opened due to prior", "enqueues." "SETMSG MSG(ISRZ002)" end end else "TBTOP" @tn@ "LIBDEF ISPTLIB" return /*@ BA_OPEN_TABLE */ /* Repro @tn@ to @TMP, adding field ONINDIC. Collect list of currently-on users. . ----------------------------------------------------------------- */ BB_REPRO: /*@ */ if branch then call BRANCH address ISPEXEC "TBQUERY" @tn@ "KEYS(kvar) NAMES(nvar)" parse var nvar "(" nvar ")" /* no bananas */ nvar = "(" nvar "ONINDIC)" "TBCREATE @TMP KEYS"kvar "NAMES"nvar "WRITE REPLACE" if rc > 4 then do sw.0error_found = 1 return end "TBTOP" @tn@ do forever "TBSKIP" @tn@ "SAVENAME(xvars)" if rc > 0 then leave /* all done */ ct.0rows = ct.0rows + 1 parse var xvars "(" xvars ")" if xvars = "" then slug = "" else slug = "SAVE("xvars")" if slug <> "" then ct.0xvars = ct.0xvars + 1 "TBMOD @TMP" slug end /* forever */ logpref = "("Branch("ID")")" call ZL_LOGMSG( logpref ct.0rows "rows transferred." ) "TBCLOSE @TMP" /* save and close */ "TBEND " @tn@ /* close */ zerrsm = "Read:" ct.0rows " XVARS=" ct.0xvars zerrlm = ct.0rows "rows were read from table" @tn@", and", ct.0xvars "of them contained extension variables." "SETMSG MSG(ISRZ002)" address TSO nowon = '' rc = Outtrap("OUT.") "WHOSON" rc = Outtrap("OFF") do zz = 1 to out.0 /* all returned lines */ if Left( out.zz,1 ) = '-' then iterate if Pos( ':',out.zz ) > 0 then iterate nowon = nowon Word( out.zz,1 ) end call ZL_LOGMSG( logpref "Users currently logged on:" nowon ) return /*@ BB_REPRO */ /* For all IDs in 'nowon', change ONINDIC to 'ON'. . ----------------------------------------------------------------- */ BC_ANNOTATE: /*@ */ if branch then call BRANCH address ISPEXEC "TBOPEN @TMP" openmode.NOUPDT do Words( nowon ) /* each user */ parse var nowon suuser nowon /* isolate */ "TBGET @TMP" if rc > 0 then iterate /* not found? */ onindic = "ON" "TBMOD @TMP" end /* nowon */ onindic = "" call BCD_SET_DEFAULT /* get default sortspec -*/ address ISPEXEC "TBSORT @TMP FIELDS("sortspec")" if rc > 0 then do zerrsm = "TBSORT failed." zerrlm = exec_name "("BRANCH("ID")")", zerrlm "SETMSG MSG(ISRZ002)" end return /*@ BC_ANNOTATE */ /* Call TBLGEN to retrieve the default sortspec for the table. . ----------------------------------------------------------------- */ BCD_SET_DEFAULT: /*@ */ if branch then call BRANCH address TSO "NEWSTACK" "TBLGEN SU DESCRIBE" pull retline /* answer from TBLGEN */ logpref = "("Branch("ID")")" call ZL_LOGMSG( logpref retline ) parse var retline "SORT(" sortspec ")" "DELSTACK" return /*@ BCD_SET_DEFAULT */ /* . ----------------------------------------------------------------- */ BD_DISPLAY_TABLE: /*@ */ if branch then call BRANCH address ISPEXEC call BDA_SETUP_LIBDEFS /* -*/ "TBTOP @TMP" "TBVCLEAR @TMP" /* ZAP all */ suuser = ' ' "TBSARG @TMP NAMECOND(SUUSER,GE)" sel = "" do forever "TBDISPL @TMP PANEL(LISTUSER)" if rc > 4 then leave if zcmd ^= "" then do "CONTROL DISPLAY SAVE" call BDP_PROCESS_ZCMD /* -*/ "CONTROL DISPLAY RESTORE" iterate end do ztdsels "CONTROL DISPLAY SAVE" select when sel = "S" then, "DISPLAY PANEL(LISTUSR1)" /* display detail */ when sel = "M" then, call BDM_SEND_MESSAGE /* -*/ otherwise nop end /* select */ "CONTROL DISPLAY RESTORE" if ztdsels > 1 then "TBDISPL @TMP" end /* ztdsels */ sel = "" end /* forever */ call BDZ_DROP_LIBDEFS /* -*/ return /*@ BD_DISPLAY_TABLE */ /* Unpack ISPF assets and LIBDEF . ----------------------------------------------------------------- */ BDA_SETUP_LIBDEFS: /*@ */ if branch then call BRANCH address ISPEXEC call DEIMBED /* -*/ dd = "" do Words(ddnlist) /* each LIBDEF DD */ parse value ddnlist dd with dd ddnlist @ddn = @ddn.dd /* PLIB322 <- PLIB */ "LIBDEF ISP"dd "LIBRARY ID("@ddn") STACK" end ddnlist = ddnlist dd return /*@ BDA_SETUP_LIBDEFS */ /* . ----------------------------------------------------------------- */ BDM_SEND_MESSAGE: /*@ */ if branch then call BRANCH address ISPEXEC "VGET ZPFCTL"; save_zpf = zpfctl /* save current setting */ zpfctl = "OFF"; "VPUT ZPFCTL" /* PFSHOW OFF */ zwinttl = "Send Message to" suuser suname "addpop row(1) column(35)" "DISPLAY PANEL(LISTUSR2)" save_rc = rc "rempop all" zpfctl = save_zpf; "VPUT ZPFCTL" /* restore */ if save_rc > 0 then return address TSO "SEND '. "copies("-",53) "Time" time()"' user("suuser") LOGON" do bx = 15 to 1 by -1 /* bottom-up */ line = value( "TXT"||bx ) if line <> "" then leave /* last non-blank line */ end /* bx */ do ctr = 1 to bx line = value("TXT"||ctr) line = Translate( line, ".", "'" ) "SEND '. "left(line,67,' ')"' user("suuser") LOGON" end return /*@ BDM_SEND_MESSAGE */ /* . ----------------------------------------------------------------- */ BDP_PROCESS_ZCMD: /*@ */ if branch then call BRANCH address ISPEXEC parse var zcmd w1 rest select when w1 = "L" then do parse var rest suuser . if suuser = "" then suuser = userid() suuser = left(suuser||"*",7) "TBTOP @TMP" "TBSCAN @TMP ARGLIST(SUUSER) CONDLIST(EQ)" if rc = 0 then do zerrsm = suuser "Found" zerrlm = suuser "is on the table" "SETMSG MSG(ISRZ002)" end /* rc = 0 */ else do zerrsm = suuser "not Found" zerrlm = suuser "is not on the table" "SETMSG MSG(ISRZ002)" return end /* else */ end /* L */ when w1 = "SORT" then do call BDPS_SORT_TABLE /* -*/ end /* SORT */ when w1 = "SEND" then do user = Translate(Space(rest,1), "," , " ") call BDM_SEND_MESSAGE /* -*/ end /* SEND */ otherwise nop end /* select */ return /*@ BDP_PROCESS_ZCMD */ /* SUUSER SUNAME SUFN SUMN SULN SUOWNER SUCREDT SULOGDT SUATTR SUDATA . ----------------------------------------------------------------- */ BDPS_SORT_TABLE: /*@ */ if branch then call BRANCH address ISPEXEC sortspec = "" text = rest zerrlm = '' if text = "DEFAULT" |, text = "" then do call BCD_SET_DEFAULT /* get default sortspec -*/ end /* default */ else, do while text <> "" parse var text spec text parse var spec fldnm "," fldtyp "," sortdir parse value fldtyp "C" with fldtyp . parse value sortdir "A" with sortdir . if WordPos(fldnm,allnames) = 0 then do /* wrong name */ zerrsm = "Sortspec error" zerrlm = zerrlm " Incorrect name: you specified >"fldnm"<. ", "The valid field names for this table are >", Space(allnames,1)"<. " end /* bad fldnm */ if Pos(fldtyp,"CN") = 0 then do /* wrong type */ zerrsm = "Sortspec error" zerrlm = zerrlm " Incorrect type: you specified >"fldtyp"<. ", "The valid field types are >C N<." end if Pos(sortdir,"AD") = 0 then do /* wrong dir */ zerrsm = "Sortspec error" zerrlm = zerrlm " Incorrect DIR: you specified >"sortdir"<. ", "The valid sort directtions are >A D<." end if zerrlm <> "" then do /* error */ zerrlm = Strip(zerrlm " Sort was not done.") "SETMSG MSG(ISRZ002)" return end sortspec = sortspec fldnm","fldtyp","sortdir end /* text */ sortspec = Space(sortspec,1) /* squeeze out extra blanks */ sortspec = Translate(sortspec,","," ") /* blanks to commas */ "TBSORT @TMP FIELDS("sortspec")" if rc > 0 then do zerrsm = "TBSORT failed." zerrlm = exec_name "("BRANCH("ID")")", zerrlm "SETMSG MSG(ISRZ002)" end return /*@ BDPS_SORT_TABLE */ /* . ----------------------------------------------------------------- */ BDZ_DROP_LIBDEFS: /*@ */ if branch then call BRANCH address ISPEXEC dd = "" do Words(ddnlist) /* each LIBDEF DD */ parse value ddnlist dd with dd ddnlist @ddn = @ddn.dd /* PLIB322 <- PLIB */ "LIBDEF ISP"dd address TSO "FREE FI("@ddn")" end ddnlist = ddnlist dd return /*@ BDZ_DROP_LIBDEFS */ /* . ----------------------------------------------------------------- */ BZ_DROP_TABLE: /*@ */ if branch then call BRANCH address ISPEXEC "TBEND @TMP" "TBERASE @TMP" return /*@ BZ_DROP_TABLE */ /* . ----------------------------------------------------------------- */ LOCAL_PREINIT: /*@ customize opts */ address TSO if SWITCH("INSTALL") then do "NEWSTACK" queue "LU" queue "0" queue "SELECT CMD(%LISTUSR &ZPARM)" queue "Show all users" "FCCMDUPD ((TRACE" tv /* load the command table -*/ "DELSTACK" exit /* no processing */ end /* Install */ sw.0SaveLog = SWITCH( "LOG" ) sw.0restarted = SWITCH( "RESTARTED" ) dfltlib = "'"DFLTTLIB( 'USER' )"'" parse value KEYWD( "ISPTLIB" ) dfltlib with, isptlib . parse value KEYWD( "ISPTABL" ) isptlib with, isptabl . parse value KEYWD( "USETBL" ) "USER" with, @tn@ . return /*@ LOCAL_PREINIT */ /* subroutines below LOCAL_PREINIT are not selected by SHOWFLOW */ /* . ----------------------------------------------------------------- */ ZB_SAVELOG: /*@ */ if branch then call BRANCH address TSO if Symbol("LOG#") = "LIT" then return /* not yet set */ "ALLOC FI(@LOG) DA("logdsn") REU" vb255.0 "EXECIO" log# "DISKW @LOG (STEM LOG. FINIS" "FREE FI(@LOG)" return /*@ ZB_SAVELOG */ /* . ----------------------------------------------------------------- */ ZL_LOGMSG: Procedure expose, /*@ */ (tk_globalvars) log. log# msglim rc = Trace("O") address TSO parse arg msgtext /* for making the msgline always reasonably short: */ do while Length(msgtext) > msglim pt = LastPos(" ",msgtext,msglim) slug = Left(msgtext,pt) if monitor then say, slug parse value log#+1 slug with, zz log.zz 1 log# . msgtext = " "Substr(msgtext,pt) end /* while msglim */ parse value log#+1 msgtext with, zz log.zz 1 log# . if monitor then say, msgtext return /*@ ZL_LOGMSG */ /* Parse out the embedded components at the back of the source code. . ----------------------------------------------------------------- */ DEIMBED: Procedure expose, /*@ */ (tk_globalvars) ddnlist @ddn. daid. address TSO fb80po.0 = "NEW DEL UNIT(VIO) SPACE(5 5) TRACKS DIR(40)", "RECFM(F B) LRECL(80) BLKSIZE(0)" parse value "" with ddnlist @ddn. daid. lastln = sourceline() currln = lastln /* */ if Left(sourceline(currln),2) <> "*/" then return currln = currln - 1 /* previous line */ "NEWSTACK" address ISPEXEC do while sourceline(currln) <> "/*" text = sourceline(currln) /* save with a short name ! */ if Left(text,3) = ")))" then do /* package the queue */ parse var text ")))" ddn mbr . /* PLIB PANL001 maybe */ if Pos(ddn,ddnlist) = 0 then do /* doesn't exist */ ddnlist = ddnlist ddn /* keep track */ @ddn = ddn || Random(999) @ddn.ddn = @ddn address TSO "ALLOC FI("@ddn")" fb80po.0 "LMINIT DATAID(DAID) DDNAME("@ddn")" daid.ddn = daid end daid = daid.ddn "LMOPEN DATAID("daid") OPTION(OUTPUT)" do queued() parse pull line "LMPUT DATAID("daid") MODE(INVAR) DATALOC(LINE) DATALEN(80)" end "LMMADD DATAID("daid") MEMBER("mbr")" "LMCLOSE DATAID("daid")" end /* package the queue */ else push text /* onto the top of the stack */ currln = currln - 1 /* previous line */ end /* while */ address TSO "DELSTACK" return /*@ DEIMBED */ /* . ----------------------------------------------------------------- */ HELP: /*@ */ address TSO;"CLEAR" if helpmsg <> "" then say helpmsg; say "" ex_nam = Left(exec_name,8) /* predictable size */ say " " say " "ex_nam" displays table USER containing all known non-machine " say " userids. " say " " say " From the display a message may be sent to any selected " say " user(s) and user data may be displayed. " say " " say " Syntax: "ex_nam" no parms " say " (( INSTALL " say " LOG " say " " say " INSTALL will load your personal command table with a " say " shortcut for this routine, 'LU'. This only " say " needs to be done once. " say " " say " LOG requests the log file be retained at process-end. " say " By default, the log is purged. " say " " "NEWSTACK"; pull ; "CLEAR" ; "DELSTACK" say " Debugging tools provided include: " say " " say " MONITOR: displays key information throughout processing. " say " " say " BRANCH: show all paragraph entries. " say " " say " TRACE tv: will use value following TRACE to place " say " the execution in REXX TRACE Mode. " say " " say " " say " Debugging tools can be accessed in the following manner: " say " " say " TSO" exec_name" parameters (( debug-options " say " " say " For example: " say " " say " TSO" exec_name " (( TRACE ?R " if sysvar("SYSISPF") = "ACTIVE" then, address ISPEXEC "CONTROL DISPLAY REFRESH" exit /*@ HELP */ /* . ----------------------------------------------------------------- */ BRANCH: Procedure expose, /*@ */ sigl exec_name rc = trace("O") /* we do not want to see this */ arg brparm . origin = sigl /* where was I called from ? */ do currln = origin to 1 by -1 /* inch backward to label */ if Right(Word(Sourceline(currln),1),1) = ":" then do parse value sourceline(currln) with pgfname ":" . /* Label */ leave ; end /* name */ end /* currln */ select when brparm = "NAME" then return(pgfname) /* Return full name */ when brparm = "ID" then do /* wants the prefix */ parse var pgfname pgfpref "_" . /* get the prefix */ return(pgfpref) end /* brparm = "ID" */ otherwise say left(sigl,6) left(pgfname,40) exec_name "Time:" time("L") end /* select */ return /*@ BRANCH */ /* . ----------------------------------------------------------------- */ DUMP_QUEUE: /*@ Take whatever is in stack */ rc = trace("O") /* and write to the screen */ address TSO "QSTACK" /* how many stacks? */ stk2dump = rc - tk_init_stacks /* remaining stacks */ if stk2dump = 0 & queued() = 0 then return say "Total Stacks" rc , /* rc = #of stacks */ "Begin Stacks" tk_init_stacks , /* Stacks present at start */ "Stacks to DUMP" stk2dump do dd = rc to tk_init_stacks by -1 /* empty each one. */ say "Processing Stack #" dd "Total Lines:" queued() do queued();pull line;say line;end /* pump to the screen */ "DELSTACK" /* remove stack */ end /* dd = 1 to rc */ return /*@ DUMP_QUEUE */ /* . ----------------------------------------------------------------- */ KEYWD: Procedure expose info /*@ hide all vars, except info*/ arg kw kw_pos = wordpos(kw,info) /* find where it is, maybe */ if kw_pos = 0 then return "" /* send back a null, not found*/ kw_val = word(info,kw_pos+1) /* get the next word */ info = Delword(info,kw_pos,2) /* remove both */ return kw_val /*@ KEYWD */ /* . ----------------------------------------------------------------- */ KEYPHRS: Procedure expose, /*@ */ info helpmsg exec_name /* except these three */ arg kp wp = wordpos(kp,info) /* where is it? */ if wp = 0 then return "" /* not found */ front = subword(info,1,wp-1) /* everything before kp */ back = subword(info,wp+1) /* everything after kp */ parse var back dlm back /* 1st token must be 2 bytes */ if length(dlm) <> 2 then /* Must be two bytes */ helpmsg = helpmsg, "Invalid length for delimiter("dlm") with KEYPHRS("kp")" if wordpos(dlm,back) = 0 then /* search for ending delimiter*/ helpmsg = helpmsg, "No matching second delimiter("dlm") with KEYPHRS("kp")" if helpmsg <> "" then call HELP /* Something is wrong */ parse var back kpval (dlm) back /* get everything b/w delim */ info = front back /* restore remainder */ return Strip(kpval) /*@ KEYPHRS */ /* . ----------------------------------------------------------------- */ NOVALUE: /*@ */ say exec_name "raised NOVALUE at line" sigl say " " say "The referenced variable is" condition("D") say " " zsigl = sigl signal SHOW_SOURCE /*@ NOVALUE */ /* . ----------------------------------------------------------------- */ SHOW_SOURCE: /*@ */ call DUMP_QUEUE /* Spill contents of stacks -*/ if sourceline() <> "0" then /* to screen */ say sourceline(zsigl) rc = trace("?R") nop exit /*@ SHOW_SOURCE */ /* . ----------------------------------------------------------------- */ SS: Procedure /*@ Show Source */ arg ssbeg ssend . if ssend = "" then ssend = 10 if \datatype(ssbeg,"W") | \datatype(ssend,"W") then return ssend = ssbeg + ssend do ssii = ssbeg to ssend ; say sourceline(ssii) ; end return /*@ SS */ /* . ----------------------------------------------------------------- */ SWITCH: Procedure expose info /*@ */ arg kw sw_val = Wordpos(kw,info) > 0 /* exists = 1; not found = 0 */ if sw_val then /* exists */ info = Delword(info,Wordpos(kw,info),1) /* remove it */ return sw_val /*@ SWITCH */ /* . ----------------------------------------------------------------- */ SYNTAX: /*@ */ errormsg = exec_name "encountered REXX error" rc "in line" sigl":", errortext(rc) say errormsg zsigl = sigl signal SHOW_SOURCE /*@ SYNTAX */ /* Can call TRAPOUT. . ----------------------------------------------------------------- */ TOOLKIT_INIT: /*@ */ address TSO info = Strip(opts,"T",")") /* clip trailing paren */ parse source sys_id how_invokt exec_name DD_nm DS_nm, as_invokt cmd_env addr_spc usr_tokn parse value "" with tv helpmsg . parse value 0 "LISTUSRH YES" "Error-Press PF1" with, sw. zerrhm zerralrm zerrsm if SWITCH("TRAPOUT") then do "TRAPOUT" exec_name parms "(( TRACE R" info exit end /* trapout */ if Word(parms,1) = "?" then call HELP /* I won't be back */ "QSTACK" ; tk_init_stacks = rc /* How many stacks? */ parse value SWITCH("BRANCH") SWITCH("MONITOR") SWITCH("NOUPDT") with, branch monitor noupdt . parse value mvsvar("SYSNAME") sysvar("SYSNODE") with, #tk_cpu node . sw.nested = sysvar("SYSNEST") = "YES" sw.batch = sysvar("SYSENV") = "BACK" sw.inispf = sysvar("SYSISPF") = "ACTIVE" parse value KEYWD("TRACE") "N" with tv . tk_globalvars = "tk_globalvars exec_name tv helpmsg sw. zerrhm", "zerralrm zerrsm zerrlm tk_init_stacks branch", "monitor noupdt" call LOCAL_PREINIT /* for more opts -*/ return /*@ TOOLKIT_INIT */ /* ))) PLIB LISTUSER .. )ATTR DEFAULT(%+_) % TYPE( TEXT ) INTENS( HIGH ) SKIP( ON ) + TYPE( TEXT ) INTENS( LOW ) SKIP( ON ) _ TYPE( INPUT ) INTENS( HIGH ) CAPS( ON ) JUST( LEFT ) PAD( _ ) } TYPE( INPUT ) INTENS( HIGH ) CAPS( ON ) JUST( LEFT ) * TYPE( OUTPUT ) INTENS( HIGH ) CAPS( OFF ) JUST( LEFT ) # TYPE( OUTPUT ) INTENS( LOW ) CAPS( OFF ) JUST( LEFT ) )BODY EXPAND(\\) WIDTH(&ZSCREENW) +\-\%List Users+\-\ %COMMAND ===>}ZCMD %SCROLL ===>}AMT + + /--- %S+- Detail %M+- Msg (PF1 for Help) + / Primary Commands Available : %L, Send, Sort + V +%Sel+% ID ON? --Name-- --OnLast-- --Data-- + --- -------- --- ------------------- ----------\-\ )MODEL ROWS( SCAN ) + }Z+ *suuser *z *suname *sulogdt *sudata )INIT .ZVARS = '(SEL ONINDIC)' .CURSOR = SEL .HELP = LISTUSRH )PROC )END ))) PLIB LISTUSRH .. )ATTR % TYPE( TEXT ) INTENS( HIGH ) SKIP( ON ) + TYPE( TEXT ) INTENS( LOW ) SKIP( ON ) _ TYPE( INPUT ) INTENS( HIGH ) ! TYPE( OUTPUT ) INTENS( HIGH ) SKIP( ON ) @ TYPE( OUTPUT ) INTENS( LOW ) SKIP( ON ) } AREA( SCRL ) EXTEND( ON ) )BODY EXPAND(||) WIDTH(&ZSCREENW) %TUTORIAL |-| LIST Users Logged On |-| TUTORIAL %Next Selection ===>_ZCMD + }hlptxt } )AREA HLPTXT + + For any UserID shown, you may request + + %M +- Send a message to this user. You will be prompted to enter your + message text. + + %S +- Display all the pertinent data for this user. + + Three primary commands are supported + + %L +- Locate a specified userID ( ex: L@ZUSER +) + + %SEND+- Invokes the SENDMSG subroutine for all the specified + userIDs ( ex: SEND user1 user2 user3+). The userIDs + specified need not be logged on. + + %SORT+- will sort the displayed table as requested. Provide a sortspec in + the form: <>>> Type and Direction default + to 'C' and 'A' respectively. Field must be one of + !allnames % 'SORT DEFAULT'+sorts the table as specified in table AAMSTR. + )PROC &ZUP = LISTUSRH &ZCONT = LISTUSRH )END ))) PLIB LISTUSR1 .. )ATTR % TYPE( TEXT ) INTENS( HIGH ) SKIP( ON ) + TYPE( TEXT ) INTENS( LOW ) SKIP( ON ) @ TYPE( TEXT ) INTENS( HIGH ) COLOR( YELLOW ) _ TYPE( INPUT ) INTENS( LOW ) CAPS( ON ) } TYPE( INPUT ) INTENS( HIGH ) CAPS( ON ) JUST( LEFT ) # TYPE( OUTPUT ) INTENS( HIGH ) CAPS( OFF ) JUST( LEFT ) \ TYPE( OUTPUT ) INTENS( LOW ) CAPS( ON ) JUST( LEFT ) )BODY EXPAND(||) WIDTH(&ZSCREENW) @|-|% User Detail @|-| %COMMAND ===>_ZCMD %SCROLL ===>_ZAMT+ + +User Name ===>#suname + +User ID ===>#suuser + +Owner ===>#suowner + +Last On ===>#sulogdt + +Created ===>#sucredt + +Attribs ===>#suattr + +Data ===>#sudata + )INIT )PROC )END ))) PLIB LISTUSR2 .. )ATTR DEFAULT(%+_) % TYPE( TEXT ) INTENS( HIGH ) SKIP( ON ) + TYPE( TEXT ) INTENS( LOW ) SKIP( ON ) } TYPE( INPUT ) INTENS( HIGH ) CAPS( OFF ) # TYPE( OUTPUT ) INTENS( HIGH ) CAPS( ON ) JUST( LEFT ) _ TYPE( INPUT ) INTENS( HIGH ) CAPS( ON ) JUST( LEFT ) PAD( '_' ) )BODY WINDOW(75,17) + + >}TXT1 +< + >}TXT2 +< + >}TXT3 +< + >}TXT4 +< + >}TXT5 +< + >}TXT6 +< + >}TXT7 +< + >}TXT8 +< + >}TXT9 +< + >}TXT10 +< + >}TXT11 +< + >}TXT12 +< + >}TXT13 +< + >}TXT14 +< + >}TXT15 +< + )INIT .HELP = SENDH1 .CURSOR = TXT1 )PROC VER (&TXT1,NB) )END ))) PLIB SENDH1 .. )ATTR % TYPE( TEXT ) INTENS( HIGH ) SKIP( ON ) + TYPE( TEXT ) INTENS( LOW ) SKIP( ON ) _ TYPE( INPUT ) INTENS( HIGH ) ! TYPE( OUTPUT ) INTENS( HIGH ) SKIP( ON ) @ TYPE( OUTPUT ) INTENS( LOW ) SKIP( ON ) )BODY EXPAND(||) %TUTORIAL |-| Message Composition |-| TUTORIAL %Next Selection ===>_ZCMD + Write your message on the 15 lines provided. + Manual line breaks are honored. + Blank lines not followed by non-blank lines are not sent. )PROC &ZUP = SENDH1 &ZCONT = SENDH1 )END */