	SUBROUTINE SHOWINFO(running_user, cmd_type, options)
	IMPLICIT INTEGER(A-Z)
C
C	SYS$SYSTEM:VMSMAIL.DAT record layout.
C
	CHARACTER  username*31	   !1:31   keyid=0
	BYTE	   mail_flags(2)   !32:33
	BYTE	   mail_count(2)   !34:35
	BYTE	   mail_spare(28)  !36:63
	BYTE	   mail_spare1(2)  !64:65
	BYTE	   dir_length	   !66:66
	BYTE	   per_length	   !67:67
	BYTE	   fwd_length	   !68:68
	CHARACTER  mail_data*639   !See below...
	CHARACTER  forward*256	   !69:69+fwd_length
	CHARACTER  personal*127	   !69:69+fwd_length+per_length
	CHARACTER  directory*256   !69:69+fwd_length+per_length+dir_length
C
C	End of VMSMAIL.DAT record layout.
C
	INTEGER*4 for_len, per_len, dir_len, name_len, mail_len, ios
	INTEGER*4 str$position, str$trim, str$match_wild, option_len
	INTEGER*4 number_nodes, node_number
	CHARACTER local_node*31, mail_node*31, hold_node(127)*31
	CHARACTER mail_file*128, name*256
	CHARACTER cmd_type*6, running_user*31, name_match*256
	CHARACTER*256 options(4)
	LOGICAL record_found, displayed_record, open_write, privl
	LOGICAL modified, new_record, updating, compare
C
	COMMON updating
	INCLUDE '($LIBDEF)'
        PARAMETER (STR$_MATCH   = 2393113)
        PARAMETER (STR$_NOMATCH = 2392584)
	EXTERNAL netmail_norecfnd, netmail_nopriv
	EXTERNAL netmail_decnet, netmail_failed, netmail_route
C
C	Set strings and logicals.
C
	displayed_record = .false.
	record_found     = .false.
	new_record       = .false.
	compare		 = .false.
	privl		 = .false.
	opened		 = .false.
	open_write	 = .false.
	modified 	 = .false.
	updating	 = .false.
	forward   = ' '
	personal  = ' '
	directory = ' '
	name      = ' '
	mail_node = ' '
	number_nodes = 0
	node_number  = 1
C
C
C
	If(cmd_type.eq.'COMPAR') then
	cmd_type = 'SHOW'
	compare = .true.
	Endif
C
C	Check to see if the user if privileged.
C
	CALL CHKPRIVS(cmd_type, privl)
	If(cmd_type(1:4).eq.'LIST') then
	   If (.not.privl) CALL LIB$SIGNAL(netmail_nopriv)
	Endif
C
C	Set up input for wildcarding.
C
	icode = STR$TRIM(options(1), options(1), option_len)
	if (option_len.ne.0) then
	options(1) = '*' // options(1)(1:option_len) // '*'
	else
	icode = STR$TRIM(options(2), options(2), option_len)
	if (option_len.ne.0)
     +  options(2) = '*' // options(2)(1:option_len) // '*'
	Endif !Option check.
C
C	Get MAIL node and local node. Note: numbers_nodes is 0 based.
C
	CALL GET_MAIL_NODE(hold_node, local_node, number_nodes)
	number_nodes = number_nodes + 1
 50	continue
	icode = STR$TRIM(hold_node(node_number), hold_node(node_number),
     +                   mail_len)
	mail_node = hold_node(node_number)(1:mail_len)
C
C	Go open mailfile.
C
	CALL OPENMAIL(mail_node, local_node, open_write, opened)
	If (.not.opened) then
	node_number = node_number + 1
	 If (node_number.gt.number_nodes) then
	 CALL LIB$SIGNAL(netmail_failed)
	 Else
	 CALL LIB$SIGNAL(netmail_route)
	 goto 50
	 Endif
	Endif
C
C	If LIST then output title.
C
	If (cmd_type(1:4).eq.'LIST') then
	CALL LIB$PUT_OUTPUT(' ')
	CALL LIB$PUT_OUTPUT('Listing NETMAIL database on '//mail_node)
	Endif
C
C	Get record.
C
100	read(unit=1,iostat=ios,err=200,END=500)
     +  username, (mail_flags(I),I=1,2), (mail_count(I),I=1,2),
     +  (mail_spare(I),I=1,28), (mail_spare1(I),I=1,2),
     +  dir_length, per_length, fwd_length, mail_data
C
200	CONTINUE
C
C	If the record matches, display it.
C
	record_found = .false.
	CALL DISPLAYREC(cmd_type, options, username, running_user,
     +              mail_data, fwd_length, per_length, modified,
     +              displayed_record, record_found, new_record, privl)
C
C	Go check another record incase there is additional matches.
C
	goto 100
C
C	If record not found, display message, then bug out.
C
500	continue
	CLOSE (UNIT=1)
C
	If(compare) then
	node_number = node_number + 1
	 If (node_number.le.number_nodes) goto 50
	Endif
C
	If (.not.displayed_record) then
	CALL LIB$SIGNAL(netmail_norecfnd)
	Endif
	CALL LIB$PUT_OUTPUT(' ')
	return
C
	end

