From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 15-AUG-1988 07:16
To:	ARISIA::EVERHART
Subj:	SUM (Show Users More) Part 1 of 4


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Fri, 12 AUG 88 21:54:38 PDT
Received: from hac2arpa.hac.com by KL.SRI.COM with TCP; Fri, 12 Aug 88 21:52:51 PDT
Received: from draco.HAC.COM by hac2arpa.hac.com (3.2/SMI-DDN)
	id AA13265; Fri, 12 Aug 88 21:58:19 PDT
Received: by draco id <24C20638022@draco.HAC.COM> ;
       Fri, 12 Aug 88 21:53:56 PDT
Date: Fri, 12 Aug 88 21:53:54 PDT
From: Michael N. Kimura <MNK@draco.hac.com>
Subject: SUM (Show Users More) Part 1 of 4
To: info-vax%kl.sri.com@hac2arpa.hac.com
X-Vms-Mail-To: EXOS%"<info-vax%kl.sri.com@hac2arpa.hac.com>",MNK
Message-Id: <880812215354.24C20638022@draco.HAC.COM>

...................... Cut between dotted lines and save. .....................
$!.............................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.00 26-May-1988.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user MNK
$! on  6-APR-1866 20:07:23.75.
$!
$! ATTENTION: To keep each article below 32 blocks (16384 bytes), this
$!            program has been transmitted in 4 parts.  You should
$!            concatenate ALL parts to ONE file and execute (@) that file.
$!
$! It contains the following 17 files:
$!        0README.1ST
$!        GET_IJOBCNT.FOR
$!        ITMLST.FOR
$!        LOAD_ITMLST_V4.FOR
$!        LOAD_ITMLST_V5.FOR
$!        MAKEFILE.V4
$!        MAKEFILE.V5
$!        MAKE_SUM.COM
$!        PARSE_CMD_LINE.FOR
$!        SHWMSG.MSG
$!        SORT.FOR
$!        SORT_INC.FOR
$!        SUM.COM
$!        SUM.HLP
$!        SUMTABLE.CLD
$!        SUM_V4.FOR
$!        SUM_V5.FOR
$!
$!==============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.00 26-May-1988 requires VMS V4.4 or higher."
$ EXIT 44 
$VERSION_OK:
$ GOTO START
$
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY
b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) )
; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE
, b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors 
:= 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN 
& "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION
( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK( NONE 
) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 ); IF s_x = "+" THEN r_skip 
:= SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip <> 0 THEN s_x := ""
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF; ENDIF
; IF s_x = "-" THEN r_skip := SEARCH( pat_end, FORWARD, EXACT ); IF r_skip <
> 0 THEN s_x := ""; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip := MARK( NONE )
; r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip <> 0 THEN POSITION
( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET ); MOVE_VERTICAL( 1 )
; MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) ); ENDIF; ERASE
( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF
; IF s_x = "V" THEN s_x := ""; IF i_append_line <> 0 THEN APPEND_LINE
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1; MOVE_VERTICAL
( 1 ); ENDIF; IF s_x = "X" THEN s_x := ""; IF i_append_line <
> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF
; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> "" THEN i_errors 
:= i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT
( "The following line could not be unpacked properly:" ); SPLIT_LINE
; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL( 1 
); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH( "`"
, FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1 )
; IF CURRENT_CHARACTER = "`" THEN MOVE_HORIZONTAL( 1 ); ELSE COPY_TEXT( ASCII
( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDIF; ENDLOOP; IF i_errors = 0 THEN SET
( NO_WRITE, b_errors, ON ); ELSE POSITION( BEGINNING_OF( b_errors ) )
; COPY_TEXT( FAO( "The following !UL errors were detected while unpacking !AS"
, i_errors, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors
, "SYS$COMMAND" ); ENDIF; EXIT; 
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!,passed." )
$ RETURN
$
$START:
$ FILE_IS = "0README.1ST"
$ CHECKSUM_IS = 2014498469
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X****************************************************************************
X`009`009`009   SUM (Show Users More)
X****************************************************************************
X
X     SUM is a program to display the same information as SHOW USERS plus the
XLAT server name and port name.  The only qualifier of SHOW  USERS  "/OUTPUT"
Xis supported as is the "username" parameter.
X
X----------------------------------------------------------------------------
X$ SUM
X          VAX/VMS Interactive Users
X           13-MAY-1988 22:03:34.31
X    Total number of interactive users = 8
X
X Username     Process Name      PID     Terminal
X BFUJIMOTO    BFUJIMOTO       214034E6  RTA2:                   
X CNDOAN       Christine       2140332D  VTA946: LTA773:  LYRA00 PORT_4
X GUTHRIE      Kevin           2140342B  VTA953: LTA780:  LYRA07 PORT_1
X ILSCM        ILSCM           21402CC9  RTA1:                   
X MNK          mnk_vta932      214028FA  VTA932: LTA759:  BOOTES 9Y7C_29AB
X OPERATOR     OPERATOR        21402A42  OPA0:                   
X RUSCH        Krakatoa        2140289D  VTA965: LTA792:  LYRA04 PORT_6
X THOMAS       THOMAS_VTA977   214034E5  VTA977: LTA804:  LYRA07 PORT_5
X----------------------------------------------------------------------------
X
X     The physical device name field of the SHOW USERS display has been moved
Xslighty to the left to accomodate a 6 character LAT  server  name  plus  the
Xport  name  field.  Since  LAT  terminal servers should be named the same as
Xtheir DECnet node database entry for downloading, we expect the name  to  be
Xonly  6 characters long and truncate if it's longer.  This usually means the
Xdisplay will fit on an 80 column screen.  The default  name  of  a  DEC  LAT
Xserver is "LAT_08002Bxxxxxx" which would get truncated.  To see the full LAT
Xserver name use the "/FULL" qualifier.
X
X---------------------------------------------------------------------------
X
XThe following are instructions on how to build SUM:
X
X`009$ @MAKE_SUM
X
XMAKE_SUM.COM  will  use  MMS  to build SUM if it is available on your system
Xotherwise it will use DCL commands to build SUM.  MAKE_SUM.COM is capable of
Xproducing  two  versions of SUM based on what version of VAX/VMS is running.
XYou need at least version 4.6 of VAX/VMS to build SUM.  If you build SUM  on
XVersion  4.6  or 4.7, then remember to rebuild SUM after you install VAX/VMS
XVersion 5.0.
X
XThe following are instructions on how to use SUM:
X
X`009$ SUM == "$disk:[directory]SUM.EXE"
X`009$ SUM [username] [/OUTPUT=filename] [/FULL]
X
XSince  SUM  requires privileges to run, if you choose not to install it with
Xthe required privileges, then you may want to execute SUM indirectly through
Xthe  DCL  command  procedure  SUM.COM.  SUM.COM  will  attempt to enable the
Xrequired privileges, execute SUM, and then restore  the  process  privileges
Xback to the state they were when you executed SUM.COM
X
X`009$ SUM == "@disk:[directory]SUM SUM"
X`009$ SUM [username] [/OUTPUT=filename] [/FULL]
X
X-----------------------------------------------------------------------------
X
XEnvironment: `009User Mode on VAX/VMS Version V4.6 or greater.
X
XPrivileges:`009WORLD`009- To get Job/Process Information
X
X`009`009On  VAX/VMS  Version  4.6  or  4.7 you need SHARE and SYSPRV
X`009`009privilege  to  obtain  the   LAT   information   since   the
X`009`009information  is  returned by issuing a $QIO to the LTDRIVER.
X`009`009On  VAX/VMS  Version  5.x  or  greater  the  information  is
X`009`009available  without privilege using $GETDVI with an item code
X`009`009of DVI$_TT_ACCPORNAM.
X
X`009`009SHARE`009- To assign a channel to a terminal already allocated
X`009`009SYSPRV`009- To override LAT terminal protection (after you have
X`009`009`009  installed the security patch).
X
XDate:`00913-May-1988
X
XAuthor:`009Michael Kimura
X
X============================================================================
XHughes Aircraft Company (RSG)`009Internet:`009mnk%draco@hac2arpa.hac.com
XMS: R2/A159`009`009     `009BITnet:`009`009mnk@draco.hac.com
XP.O. Box 92426`009`009     `009EDEN:`009`009draco::mnk
XLos Angeles,  CA  90009`009`009Telephone:`009(213) 615-9775
X============================================================================
$ GOSUB UNPACK_FILE
$ FILE_IS = "GET_IJOBCNT.FOR"
$ CHECKSUM_IS = 218826290
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X!*===========================================================================
X!* Get_IJobCnt -- Retrieves from external symbol the Interactive Job Count
X!*`009`009  (HACK since FORTRAN lacks pointers)
X!*===========================================================================
X
X`009options/extend_source`009`009!* Allow lines longer than 72 chars
X
X`009integer*2 function Get_IJobCnt(SYS$GW_IJOBCNT)
X
X`009implicit none`009`009`009!* Declare EVERYTHING!
X
X`009integer*2
X`0091`009SYS$GW_IJOBCNT`009`009!* Address to read
X
X`009Get_IJobCnt = SYS$GW_IJOBCNT`009!* Grab the IJobCnt
X
X`009return
X`009end
$ GOSUB UNPACK_FILE
$ FILE_IS = "ITMLST.FOR"
$ CHECKSUM_IS = 1511873405
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X!*---------------------------------------------------------------------------
X!* Item List for either GETJPI or GETDVI
X
X`009structure /ItmLst/`009`009!* Item List Structure
X`009`009integer*2 BufLen /0/`009!* Buffer Length
X`009`009integer*2 ItmCod /0/`009!* Item Code
X`009`009integer*4 BufAdr /0/`009!* Buffer Address
X`009`009integer*4 RetLen /0/`009!* Return Length
X`009end structure
X
X`009record /ItmLst/
X`0091`009GetJpi_ItmLst(5),`009!* GETJPI Item List
X`0091`009GetDvi_ItmLst(3)`009!* GETDVI Item List
$ GOSUB UNPACK_FILE
$ FILE_IS = "LOAD_ITMLST_V4.FOR"
$ CHECKSUM_IS = 1259306551
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X!*===========================================================================
X!* Load_ItmLst -- Load GETJPI and GETDVI Item Lists
X!*===========================================================================
X
X`009options/extend_source`009`009!* Allow lines longer than 72 chars
X
X`009subroutine Load_ItmLst(
X`0091`009GetJpi_ItmLst,
X`0091`009Username,
X`0091`009Username_Len,
X`0091`009PrcNam,
X`0091`009PrcNam_Len,
X`0091`009PID,
X`0091`009Terminal,
X`0091`009Terminal_Len,
X`0091`009GetDvi_ItmLst,
X`0091`009TT_PhyDevNam,
X`0091`009TT_PhyDevNam_Len)
X
X`009implicit none
X
X`009include '($jpidef)'`009`009!* Include GETJPI defintions
X`009include '($dvidef)'`009`009!* Include GETDVI defintions
X
X`009include 'ItmLst'`009`009!* Include Item List Structure
X
X`009character*(*)
X`0091`009Username,`009`009!* Username buffer
X`0091`009PrcNam,`009`009`009!* Process Name buffer
X`0091`009Terminal,`009`009!* Terminal Name buffer
X`0091`009TT_PhyDevNam`009`009!* Physical Device Name of Terminal
X
X`009integer*4
X`0091`009PID`009`009`009!* PID
X
X`009integer*2
X`0091`009Username_Len,`009`009!* Username length
X`0091`009PrcNam_Len,`009`009!* Process Name length
X`0091`009Terminal_Len,`009`009!* Terminal Name length
X`0091`009TT_PhyDevNam_Len`009!* Physical Device Name length
X
X!---------------------------------------------------------------------------
X!* Load the GETJPI Item List
X
X`009!-------------------------------------------------------------------
X`009!* Username
X
X`009GetJpi_ItmLst(1).BufLen = len(Username)
X`009GetJpi_ItmLst(1).ItmCod = JPI$_USERNAME
X`009GetJpi_ItmLst(1).BufAdr = %loc(Username)
X`009GetJpi_ItmLst(1).RetLen = %loc(Username_Len)
X
X`009!-------------------------------------------------------------------
X`009!* Process Name
X
X`009GetJpi_ItmLst(2).BufLen = len(PrcNam)
X`009GetJpi_ItmLst(2).ItmCod = JPI$_PrcNam
X`009GetJpi_ItmLst(2).BufAdr = %loc(PrcNam)
X`009GetJpi_ItmLst(2).RetLen = %loc(PrcNam_Len)
X
X`009!-------------------------------------------------------------------
X`009!* PID
X
X`009GetJpi_ItmLst(3).BufLen = 4
X`009GetJpi_ItmLst(3).ItmCod = JPI$_PID
X`009GetJpi_ItmLst(3).BufAdr = %loc(PID)
X
X`009!-------------------------------------------------------------------
X`009!* Terminal Name
X
X`009GetJpi_ItmLst(4).BufLen = len(Terminal)
X`009GetJpi_ItmLst(4).ItmCod = JPI$_TERMINAL
X`009GetJpi_ItmLst(4).BufAdr = %loc(Terminal)
X`009GetJpi_ItmLst(4).RetLen = %loc(Terminal_Len)
X
X!---------------------------------------------------------------------------
X!* Load the GETDVI Item List
X
X`009!-------------------------------------------------------------------
X`009!* Physical Device Name
X
X`009GetDvi_ItmLst(1).BufLen = len(TT_PhyDevNam)
X`009GetDvi_ItmLst(1).ItmCod = DVI$_TT_PHYDEVNAM
X`009GetDvi_ItmLst(1).BufAdr = %loc(TT_PhyDevNam)
X`009GetDvi_ItmLst(1).RetLen = %loc(TT_PhyDevNam_Len)
X
X`009return
X`009end
$ GOSUB UNPACK_FILE
$ FILE_IS = "LOAD_ITMLST_V5.FOR"
$ CHECKSUM_IS = 1046654369
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X!*===========================================================================
X!* Load_ItmLst -- Load GETJPI and GETDVI Item Lists
X!*===========================================================================
X
X`009options/extend_source`009`009!* Allow lines longer than 72 chars
X
X`009subroutine Load_ItmLst(
X`0091`009GetJpi_ItmLst,
X`0091`009Username,
X`0091`009Username_Len,
X`0091`009PrcNam,
X`0091`009PrcNam_Len,
X`0091`009PID,
X`0091`009Terminal,
X`0091`009Terminal_Len,
X`0091`009GetDvi_ItmLst,
X`0091`009TT_PhyDevNam,
X`0091`009TT_PhyDevNam_Len,
X`0091`009TT_AccPorNam,
X`0091`009TT_AccPorNam_Len)
X
X`009implicit none
X
X`009include '($jpidef)'`009`009!* Include GETJPI defintions
X`009include '($dvidef)'`009`009!* Include GETDVI defintions
X
X`009include 'ItmLst'`009`009!* Include Item List Structure
X
X`009character*(*)
X`0091`009Username,`009`009!* Username buffer
X`0091`009PrcNam,`009`009`009!* Process Name buffer
X`0091`009Terminal,`009`009!* Terminal Name buffer
X`0091`009TT_PhyDevNam,`009`009!* Physical Device Name of Terminal
X`0091`009TT_AccPorNam`009`009!* Name of local port on remote system
X
X`009integer*4
X`0091`009PID`009`009`009!* PID
X
X`009integer*2
X`0091`009Username_Len,`009`009!* Username length
X`0091`009PrcNam_Len,`009`009!* Process Name length
X`0091`009Terminal_Len,`009`009!* Terminal Name length
X`0091`009TT_PhyDevNam_Len,`009!* Physical Device Name length
X`0091`009TT_AccPorNam_Len`009!* Node/Port Name length
X
X!---------------------------------------------------------------------------
X!* Load the GETJPI Item List
X
X`009!-------------------------------------------------------------------
X`009!* Username
X
X`009GetJpi_ItmLst(1).BufLen = len(Username)
X`009GetJpi_ItmLst(1).ItmCod = JPI$_USERNAME
X`009GetJpi_ItmLst(1).BufAdr = %loc(Username)
X`009GetJpi_ItmLst(1).RetLen = %loc(Username_Len)
X
X`009!-------------------------------------------------------------------
X`009!* Process Name
X
X`009GetJpi_ItmLst(2).BufLen = len(PrcNam)
X`009GetJpi_ItmLst(2).ItmCod = JPI$_PrcNam
X`009GetJpi_ItmLst(2).BufAdr = %loc(PrcNam)
X`009GetJpi_ItmLst(2).RetLen = %loc(PrcNam_Len)
X
X`009!-------------------------------------------------------------------
X`009!* PID
X
X`009GetJpi_ItmLst(3).BufLen = 4
X`009GetJpi_ItmLst(3).ItmCod = JPI$_PID
X`009GetJpi_ItmLst(3).BufAdr = %loc(PID)
X
X`009!-------------------------------------------------------------------
X`009!* Terminal Name
X
X`009GetJpi_ItmLst(4).BufLen = len(Terminal)
X`009GetJpi_ItmLst(4).ItmCod = JPI$_TERMINAL
X`009GetJpi_ItmLst(4).BufAdr = %loc(Terminal)
X`009GetJpi_ItmLst(4).RetLen = %loc(Terminal_Len)
-+-+-+-+-+ End of part 1 +-+-+-+-+-

