	"P" is a program for looking at other jobs, somewhat similar to "J"
or "K" on the PDP-10.  The following files are required for building "P" ac-
cording to the directions given here:

P.MAR				;the source
DPY.MAR				;the display package
DPYDEF.MAR			;definitions for the display package
SYS$SYSTEM:SYS.STB		;symbols
P.COM				;command file for building the program
P.HLP				;this file, to tell you how to do it.

	Obviously, P.COM and P.HLP are not required for the actual program.
	To build P, have all files listed above other than the system symbol
table on your current default directory, and type:

		$@P

This will invoke the command procedure to build the program on the default
directory.
	The program requires CMEXEC and CMKRNL privileges to run.  Read
access to the quota files on various volumes is required if quota information
is to be obtained, as normal QIO's are used for this purpose.  It has been
set up so that it will not allow a user to look at information other than
that found in permanently resident control blocks (PCB and JIB) for processes
whose UIC's differ from the executing process (as determined by the default
privileges in the control region of the process), unless the user has WORLD
privilege (thereby allowing him to spy on any process) or GROUP privilege
(allowing him to look at processes with the same group number).  Note that
this is slightly different from the "standard" VMS interpretation.  Also,
because P diddles the scheduling of a process somewhat, one is not allowed
to set the sleep time less than 5 seconds unless he has CMKRNL privilege.
This is because at the small sleep times, the watched process will tend
to get a larger share of the CPU time.
	"P" is meant to run under VMS version 2 systems only.
Future minor releases of VMS will probably not change anything, however major
releases may cause some difficulties.
	"P" also requires (normally) the terminal to be set to FULL_DUPLEX
in order to update properly.  If not set, then the user will have to type
characters between each screenful to allow the program to continue.
	Upon running "P" a default summary of all processes on the
system will be displayed.  Commands may be input at any time; they are as
follows ("$" represents <ESC>):

	Pnnn$		display the process whose index (low order half of
			the PID) is nnn.  The entire PID may be input, but
			only the index is followed.  The program tracks
			a new process if a process with a given index logs
			out and a new one logs in.

	Znnn$		sets the sleep time to nnn seconds.  The default
			is 5 seconds; the minimum recommended time is 1
			second.  Zero is a legal but not recommended value.

	S[nn$]		display the default summary, starting at process nn
			if specified ([] means optional and they are not
			typed).  If nn is not typed within 2 seconds after
			the S command, the old value will be used (defaults
			to 0).

	R		refresh the screen

	<SP>		wake the program (speeds up the update cycle)

	^nn$		in the I/O channel display, disregard the first
			nn channels (whether active or not).  This is useful
			if a job has too many channels to fit on the screen
			and all of the interesting activity occurs in the
			later channels.  The offset remains in effect until
			another ^ command is given (even if you change the
			process you are looking at) (^$ resets it)

	A		toggle the flag which enables the usage of AST's to
			gain information from other processes.  The default is
			to use AST's.

	Fn$		For summary, display only frame n (useful for systems
			with MAXPROCCNT>48).  This number is 1 based; n=0
			means to cycle through all frames.  Wait time between
			cycles is the same time as set by the Z command.

	Because P displays information which can be obtained only by running
in the context of the process being watched, it will tend to cause time to be
charged to the process being watched.  It compensates somewhat for this; only
AST overhead is actually charged for, and that is compensated for every 50
scans (the CPU time of the watched process is decreased by one centisecond,
and yours is increased by a similar amount.  This last fix may cause you to
occasionally observe the CPU time for a process to decrease; however, if such
is observed, be assured that it has increased more than that already.
	The full display of P is described below.  Things which are obvious
are not commented upon.
	The first line shows the process ID (PID), terminal logged in (if
applicable), the username (as found in the process' control region), the
alternate username if different from the username (found in the JIB), and
the login time.
	The second line displays the image name and count (the count is in
square brackets) followed by the priority (base/current) and state of the
process.  The last part of this line shows the access modes for which AST's
are currently active.
	The third line shows working set information in the following
form:

sharable pages+private pages [limit/quota/authorized quota]

This is followed by the CPU time and limit (if it exists), and finally by
the list of access modes for which AST's are currently enabled.
	The fourth line shows various quotas:  current byte count followed
by the maximum count (for buffered I/O); buffered and direct I/O operations
(in the form #left/max #/total operations); number of AST's left followed
by the limit; and number of files left followed by the limit.
	The fifth line shouws paging statistics:  the numbe of page
faults the job has incurred, the maximum number of pages which are
addressable as defined by the current P0 and P1 length registers, and
the page file limit/quota of the job.  This is followed by the sub-process
count/quota of the process.
	The sixth line shows the time queue element limit/quota, the status
of the job, the master PID (applicable if a subprocess), and the mutex count.
	The seventh line shows the default, current, image, and authorized
privilege vectors.
	The eighth line shows the event flag wait mask, followed by event
flag clusters 0 and 1; also 2 and/or 3 if they exist.  The waiting cluster
is shown by an ">" separating the cluster number and its contents, rather
than a colon.  The waiting cluster is, of course, only applicable if the
process is in an event flag wait.
	The ninth line shows the stack pointers for each of the access modes
and the current PC.  The stack whose header appears in CAPITAL LETTERS is
the stack of the current access mode.  If no header appears in caps, then
the process is running in compatability mode.
	The tenth line shows the default device and path, the default pro-
tection, and the account of the job.
	The eleventh line shows disk quotas for each disk in the system.
The format is:
	used/quota+overdraft		;for quotas which can be
					;read
	*				;if there is no quota
	?				;if the quota cannot be determined.
	The twelfth line is always blank; the rest of the screen is devoted
to a display of the devices owned by the process.  Devices which have channels
assigned are displayed first, followed by those which are only allocated.
For devices which have channels assigned, the display shows the device
name, the access mode of the assignment, the volume name (if a mounted
volume), the file id of the file being accessed on the channel (if ap-
plicable), the number of outstanding I/O requests on the channel,
the direction of the current transfer (if available; "<" means input
and ">" means output), the access mode of allocation (if applicable),
and the starting virtual block currently mapped (VBM), current
virtual block being read (VBN) or current logical block being read
(LBN) followed by the total number of virtual blocks in the
file (if applicable).
	In the case of terminals, the state bits of the terminal are
shown in lieu of the block information.  The bits are defined in the
form TTY$V_ST_xxx in TTYUCBDEF.MAR and the following strings are
displayed for each value of xxx:

	xxx			string displayed

	XON			XON
	XOFF			XOFF
	CTRLS			^S
	FILL			F
	CURSOR			CRS
	SENDLF			LF
	MULTI			M
	WRITE			O
	BRDCST			B
	EOL			EOL
	CTRLR			^R
	READ			I
	CTRLO			^O
	DEL			DEL
	PASALL			*I
	NOECHO			NE
	WRTALL			*O
	PROMPT			P
	NOFILTR			~
	ESC			$
	BADESC			~$
	NL			NL
	REFRSH			RF
	TYPFUL			^G
	SKIPLF			~LF
	GETAHD			%
	UNSOL			U
	ESC_O			$O
	CTRLSP			^SP
	WRAP			W

Also in this area, the terminal speed followed by the default speed in
parenthesis is displayed.
	Terminals additionally may show a line of input or output in
place of the volume name and file id.  This is the first line available;
current input is displayed if possible; current output if it is available
and current input is not; or type ahead if available and the previous two
items were not.  Output always shows the ">" character for direction of
I/O.
	If a device is mounted /FOREIGN, it is noted following the volume
name, which is in square brackets.
	For devices which are allocated but have not channels assigned,
only the access mode of allocation, the volume name, and the /FOREIGN
indication are shown.
