Re: PROCESS_SCAN.COM (or an example of what DCL can do)



Here one more try...


$ proc_ver = F$ENVIRONMENT("VERIFY_PROCEDURE")
$ image_ver = F$ENVIRONMENT("VERIFY_IMAGE")
$! set noverify
$ goto INFOEND
$!
==========================================================================
$!
$ info:
$ ERASE
$ Type Sys$Input

PROCEDURE: PROCESS_SCAN.COM
AUTHOR: Keith Cayemberg
DATE: original version written sometime in the mid 1980's

DESCRIPTION:

This procedure provides a means to scan the JPI process context
variables
of other user's processes on the same node or cluster. Depending on
the
identity of the other processes, you will need the GROUP or WORLD
privilege
to see the other user's context. Global Symbols with the key
attributes
of the last process found are created for use in DCL command
procedures.

PROCESS_SCAN accepts selection criteria as either "positional
parameters",
whereby meaning is determined by its sequence P1 to P6 on the
command
line, or as "named parameters" inwhich the meaning and an operator
are
given explicitly. Positional and Named Parameters can be mixed, but
the
Named parameters mask their corresponding parameter position as
unused.
A Positional and Named parameter cannot use the same Process Context
Variable as a selection criteria.

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Positional Parameters: P U N J I S

P1 = Processname find only processes with this process name or PID
number or
list of process names (use * in name as a
wildcard)
ALL, *, "" processes with any process name (default)
"=", . processes having the same first 2 chars in
Processname
<> processes not having the same first 2 chars in
Processname
? displays this help documentation.

P2 = Username only processes owned by this user or list of users
(use * only at end of name as a wildcard for
matches)
ALL, *, "" processes belonging to any user (default)
=, . processes belonging to the current user
<> processes not belonging to the current user

P3 = Nodename only processes on the indicated node or node list
(use * in name as a wildcard for matches)
"", =, . processes only on current node (default)
<> only processes not on current node
* processes on any node in current cluster

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Positional Parameters: (continued) P U N J I S

P4 = Jobtype only processes with the specified job type
Keywords: DETACHED (or 0), NETWORK (or 1), BATCH
(or 2),
LOCAL (or 3), DIALUP (or 4), REMOTE (or
5)
*, "" matches all jobtypes
=, . processes with JOBTYPE = DETACHED
<> processes with JOBTYPE <> DETACHED

P5 = Imagename only processes running this image
(name always used as wildcard match to full path/
filename)
IDLE only idle processes at DCL level
BUSY only processes running an image
*, "" processes running any image or idle
=, . processes running image in current default
directory
<> processes running image not in current default
directory

P6 = State only processes having this state will match
*, "" matches all states
=, . processes with STATE = HIB
<> processes with STATE <> HIB

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Positional Parameters: (continued) P U N J I S

P7, P8 = Process Context Variables to be displayed (see
list).
Use "*" as a wildcard (or "ALL") to indicate all
variables
are to be displayed. If none of these parameters
are
entered, then no variables are displayed.

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Qualifiers affecting scan behavior:

/CONTINUE This qualifier (P2 to P8) causes continuous
scanning
/CONT= until stopped with a Control-C. The DSTOP variant
will
/CONT=00:00:05 stop scanning after first finding at least one
process
/DSTOP with the selection criteria, and then finding none.
/DSTOP= The default pause time between updates is 3
seconds.
/DSTOP=::1 A "=" without a time value will set a time of 0
seconds.

/BELL After finding at least one process in a continuous
display,
this qualifier (P2 to P8) causes a warning bell to
ring 4
times if no process is found, and 2 times if found
again.

/FIRST This qualifier (P2 to P8) stops with the first
process
matching the search criteria.

/PAGE This qualifier (P2 to P8) causes the output to be
paged.

/QUIET This qualifier (P2 to P8) disables output. This
qualifier
also turns continuous display mode off.

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Named Parameters:
This format can be used in place of any parameter P1 to P8

PARAMETER-FORMAT MEANING
item=value equals
item>value greater than
item<value less than
item>=value greater than or equal to
item<=value less than or equal to
item<>value not equal to
item><value ANY one of a list must be true
item==value ALL of a list must be true

ITEM can be one of:
ACCOUNT, ACCNT; AUTHPRI, AUTH; CHECK; CURPRIV, CUR; GRP, GROUP;
HW_MODEL,
HWMODEL, MODEL, MOD; HW_NAME, HW, HWNAME; JOBPRCCNT, JOBCNT;
JOBTYPE,
JOB, JOBTYP; MASTER_PID, MASTER; MEM, MEMBER, MBR, MEMB; MODE,
MOD;
NODE_CSID, CSID; NODENAME, NODE; OWNER, OWN; PERCENT; PRCCNT,
PROCCNT,
COUNT; PRCNAM, PROC, PROCESS, PROCNAM; PRI, PRIO, PRIORITY; PRIB,
BASE;
STATE; STS, STATUS; TERMINAL, TERM; UIC; USERNAME, USER; PID

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
CHECK=quota parameter:

This qualifier can be used in place of any parameter from P1 to P8
This causes Process_Scan to examine a specified quota for an
inadequate
value. Any quota ending in "LM" with a corresponding JPI Process
Context
Variable ending in "CNT" can be specified. Only the "=" operator
should be
used with this parameter. Other operators are ignored. If no
operator or
quota is specified, the default is "CHECK=PGFLQUOTA". Possible
quotas
which may be checked are as follows:

CHECK=BIOCNT CHECK=BIOLM CHECK=BYTCNT CHECK=BYTLM
CHECK=DIOCNT CHECK=DIOLM CHECK=ENQCNT CHECK=ENQLM
CHECK=FILCNT CHECK=FILLM CHECK=PRCCNT CHECK=PRCLM
CHECK=TQCNT CHECK=TQLM CHECK=PGFLQUOTA

The PGFLQUOTA quota checks whether VIRTPEAK has a >= value.
The PRCLM quota checks whether JOBPRCCNT or PRCCNT is a >= value.
All other "LM" quotas check if the corresponding "CNT" quota equals
zero by
default. With the PERCENT=nn Qualifier, the processes which have <=
this
percentage (0 to 100%) of the specified resource available are
selected.

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Process Context Variables:

ACCOUNT account name of the process DIOLM direct I/O quota
limit
APTCNT active page table count DIRIO direct I/O
operations
ASTACT access modes with active ASTs EFCS LEF state, flags
0-31
ASTCNT remaining AST quota EFCU LEF state, flags
32-63
ASTEN access modes with ASTs enabled EFWM event flag wait
mask
ASTLM AST limit quota ENQCNT remaining lock
req. quota
AUTHPRI authorized base priority ENQLM lock request quota
AUTHPRIV authorized priviledges FILCNT remaining open
file quota
BIOCNT remaining buffered I/O quota FILLM open file limit
quota
BIOLM buffered I/O limit quota FREP0VA 1st free page
address (P0)
BUFIO buffered I/O operations FREP1VA 1st free page
address (P1)
BYTCNT remaining buff. I/O byte count FREPTECNT # of free pages
for VM exp.
BYTLM buffered I/O byte limit quota GPGCNT global page count
in WS
CLINAME command language interpreter GRP group number from
UIC
CPULIM CPU time limit IMAGE active image file
name
CPUTIM accumulated CPU Time IMAGECOUNT # of images run by
process
CURPRIV current priviledges IMAGNAME dir. & image file
name
DFPFC def. page fault cluster size IMAGPRIV installed image
priviledges
DFWSCNT def. working set cluster size JOBPRCCNT # of subprocesses
this job
DIOCNT remaining direct I/O quota JOBTYPE execution mode of
root proc

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Process Context Variables:(continued)

LAST_LOGIN_I last interactive login PID process ID
number
LAST_LOGIN_N last noninter. login PPGCNT # pages in WS
LOGIN_FAILURES # of login failures PRCCNT # subprocs of
this proc
LOGIN_FLAGS login seq. LOGINOUT flgs PRCLM job subprocess
quota
LOGINTIM login time PRCNAM process name
MASTER_PID master process ID # PRI current
priority
MAXDETACH max # detached processes PRIB base priority
MAXJOBS max # active processes PROC_INDEX process index
number
MEM member number from UIC PROCESS_RIGHTS process rights
MODE process mode PROCPRIV default
priviledges
MSGMASK default message mask RIGHTSLIST avail proc &
sys rights
NODE_CSID VAXcluster node ID # SHRFILLM max # open
shared files
NODE_VERSION VMS version number SITESPEC per-process
site-spec #
NODENAME Vaxcluster node name STATE current
process state
OWNER PID of creator process STS current status
flags 1
PAGEFLTS total # of page faults STS2 current status
flags 2
PAGFILCNT remain. page file quota SWPFILLOC swap file
location
PAGFILLOC current page file assign SYSTEM_RIGHTS system rights
PGFLQUOTA paging file quota TABLENAME file spec of
CLI
PHDFLAGS process header flags

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Process Context Variables:(continued)

TERMINAL login terminal name (virtual terminal if enabled)
TMBU termination mailbox unit number
TQCNT remaining timer queue entry quota
TQLM process's limit on timer queue entries
TT_ACCPORNAM access port name - (termserver/port) or (src.node/usr-
name)
TT_PHYDEVNAM physical terminal name - if 0 then virt. term. is
disconnected
UAF_FLAGS UAF flags from user/owner of process
UIC user identification code
USERNAME user name of process's owner
VIRTPEAK virtual peak address size of process
VOLUMES number of volumes currently mounted by process
WSAUTH maximum authorized working set size
WSAUTHEXT maximum authorized working set extent
WSEXTENT current working set extent
WSPEAK peak working set size
WSQUOTA working set size quota
WSSIZE current working set size
ALLIO Direct IO + Bufferred IO (this is used for I/O Heading
values)

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Global Symbols:

The following global symbols are updated at completion of the
process scan
giving the job/process information of the last process found
matching
the selection criteria. The /FIRST switch can be used to assign the
attributes of the first process which is found to the symbols.

PS_COUNT The number of processes matching the
search
criteria. If PS is aborted, then the
count
is given as a negative value.
PS_ALLIO ALL I/O in pagelets (both direct and
buffered)
PS_CPUTIM accumulated CPU TIMe
PS_IMAGE full IMAGE filename or "IDLE"
PS_JOB JOB type
PS_NODE NODE name on which the process exists
PS_PAGEFLTS total number of PAGEFauLTS
PS_PID Process IDentification number
(cluster unique)
PS_PRCNAM PRoCess NAMe (node unique)
PS_PRI current process PRIority
PS_STATE process STATE
PS_USER USERname

$ READ /PROMPT="Press Enter to continue:" sys$command noop
$ ERASE
$ Type Sys$Input
Examples:

$ @PROCESS_SCAN CS*,LA* STATE<>HIB /CONT

This example gives continuous information about non-HIBernating
processes having a process name beginning with 'CS' or 'LA'
for the local node only. Screen updates occur every 3 seconds.

$ @PROCESS_SCAN "" LAGOSMAN * BATCH "" HIB *WS*

This example scans the entire cluster for processes
in batch mode with the username LAGOSMAN and displays all
working storage values for each process in the HIBernate state.

$ @PROCESS_SCAN * LAG* CH07 3 LAGOS.EXE * PGFLQUOTA VIRT*

This example scans the Page File Quota and Virtual Peak
values for all LOCAL processes that are on node CH07,
having a username starting with 'LAG', and running LAGOS.EXE

$ TEMP = F$VERIFY(PROC_VER, IMAGE_VER)
$ exit
$ INFOEND:
$!
==========================================================================
$!
$ TRUE = 1
$ FALSE = 0
$!
$ c_abort = FALSE
$ on error then goto abort_c
$ on control_y then goto abort_c
$!
$ JPILIST1 = -
"ACCOUNT,ALLIO,APTCNT,ASTACT,ASTCNT,ASTEN,ASTLM,AUTHPRI," + -
"AUTHPRIV,BIOCNT,BIOLM,BUFIO,BYTCNT,BYTLM,CLINAME,CPULIM,CPUTIM," +
-

"CURPRIV,DFPFC,DFWSCNT,DIOCNT,DIOLM,DIRIO,EFCS,EFCU,EFWM,ENQCNT,ENQLM,"
+ -

"FILCNT,FILLM,FREP0VA,FREP1VA,FREPTECNT,GPGCNT,GRP,IMAGE,IMAGECOUNT,"
+ -
"IMAGNAME,IMAGPRIV,JOBPRCCNT,JOBTYPE,LAST_LOGIN_I,LAST_LOGIN_N," +
-
"LOGIN_FAILURES,LOGIN_FLAGS,LOGINTIM,MASTER_PID,MAXDETACH,MAXJOBS,"
+ -
"MEM,MODE,MSGMASK,NODE_CSID,NODE_VERSION,NODENAME,OWNER,"
$ JPILIST2 = -
"PAGEFLTS,PAGFILCNT,PAGFILLOC,PGFLQUOTA,PHDFLAGS,PID,PPGCNT," + -
"PRCCNT,PRCLM,PRCNAM,PRI,PRIB,PROC_INDEX,PROCESS_RIGHTS," + -
"PROCPRIV,RIGHTSLIST,SHRFILLM,SITESPEC,STATE,STS,STS2," + -
"SWPFILLOC,SYSTEM_RIGHTS,TABLENAME,TERMINAL,TIME,TMBU,TQCNT,TQLM,"
+ -

"TT_ACCPORNAM,TT_PHYDEVNAM,UAF_FLAGS,UIC,USERNAME,VIRTPEAK,VOLUMES," +
-
"WSAUTH,WSAUTHEXT,WSEXTENT,WSPEAK,WSQUOTA,WSSIZE"
$!find current image name
$ proc = f$parse(f$getjpi ("","imagname"),,,"NAME")
$!
$ SAY = "WRITE SYS$OUTPUT"
$!
$!initialize terminal screen control symbols
$ ESC = ""
$ ENQ = ""
$ LF = ""
$ CR = ""
$ DCS = ""
$ ES = ""
$ EStoEND = ""
$ EStoHERE = ""
$ ESline = ""
$ ESlinetoend = ""
$ ESlinetohere = ""
$ BELL = ""
$ TOP = ""
$ SWSH = ""
$ DW*SH = ""
$ DHT = ""
$ DHB = ""
$ NORM = ""
$ BOLD = ""
$ UNDER = ""
$ BLINK = ""
$ INVERSE = ""
$ BOLDOFF = ""
$ UNDEROFF = ""
$ BLINKOFF = ""
$ INVERSEOFF = ""
$ ONEUP = ""
$ NEXTLINE = ""
$ CURSORON = ""
$ CURSOROFF = ""
$ ER*ASE = ""
$ if f$mode() .eqs. "BATCH" then goto skip_term_codes
$!
$!define terminal screen control symbols
$ ESC[0,8]=27
$ ENQ[0,8]=5
$ LF[0,8]=10
$ CR[0,8]=13
$ CSI := "''ESC'["
$ DCS := "''ESC'P"
$ ES := "''ESC'[2J"
$ EStoEND := "''ESC'[0J"
$ EStoHERE := "''ESC'[1J"
$ ESline := "''ESC'[2K"
$ ESlinetoend := "''ESC'[0K"
$ ESlinetohere := "''ESC'[1K"
$ TOP := "''ESC'[H"
$ SWSH := "''ESC'#5"
$ DW*SH := "''ESC'#6"
$ DHT := "''ESC'#3"
$ DHB := "''ESC'#4"
$ NORM := "''ESC'[m"
$ BOLD := "''ESC'[1m"
$ UNDER := "''ESC'[4m"
$ BLINK := "''ESC'[5m"
$ INVERSE := "''ESC'[7m"
$ BOLDOFF := "''ESC'[22m"
$ UNDEROFF := "''ESC'[24m"
$ BLINKOFF := "''ESC'[25m"
$ INVERSEOFF := "''ESC'[27m"
$ ONEUP := "''ESC'[1A"
$ NEXTLINE := "''LF'''CR'"
$ CURSORON:= "''CSI'?25h" !shows cursor
$ CURSOROFF:= "''CSI'?25l" !hides cursor
$!
$ skip_term_codes:
$!
$! initialize variables
$ ER*ASE := WRITE SYS$OUTPUT ES,TOP
$ ERRMSG = ""
$ TERM_DEVICE = f$getdvi("TT","TT_PHYDEVNAM")
$ TERM_TYPE = f$extract(0,4,TERM_DEVICE)
$ TERM_WIDTH = F$getdvi("TT","DEVBUFSIZ")
$ TERM_HEIGHT = f$getdvi("TT","TT_PAGE")
$ CURRENT_TERM_HEIGHT = TERM_HEIGHT
$ JUMP = TERM_HEIGHT / 3
$ HEADER = 2
$ FOOTER = 1
$ JUMP_BUFFER = JUMP + (JUMP/2) + HEADER + FOOTER
$ MAX_LINECOUNT = 42
$ MIN_LINECOUNT = 6
$ LINECOUNT = 0
$ PSCOUNT = 0
$ PERCENT = 0
$!
$ PS_COUNT == 0
$ PS_PID == ""
$ PS_PRCNAM == ""
$ PS_USER == ""
$ PS_NODE == ""
$ PS_JOB == ""
$ PS_IMAGE == ""
$ PS_STATE == ""
$ PS_PRI == ""
$ PS_CPUTIM == ""
$ PS_ALLIO == ""
$ PS_PAGEFLTS == ""
$ PS_PGFLQUOTA == "INVALID!"
$ PS_VIRTPEAK == "INVALID!"
$ PS_TIME="NOT_FOUND"
$ JPI_TIME="NOT_FOUND"
$!
$ SYMBOLCNT = 0
$ DEFAULT_WAIT_TIME = "00:00:03.00"
$ DISPLAY_HEAD_ONLY = FALSE
$ img = ""
$!
$ COMMAND_LINE =
P1+"§"+P2+"§"+P3+"§"+P4+"§"+P5+"§"+P6+"§"+P7+"§"+P8+"§"
$ PARSED_LINE = f$edit(COMMAND_LINE,"UPCASE,COLLAPSE,TRIM")
$!
$ P1 = ""
$ P2 = ""
$ P3 = ""
$ P4 = ""
$ P5 = ""
$ P6 = ""
$ P7 = ""
$ P8 = ""
$ P9 = ""
$ P10 = ""
$!
$!---------------------------------------------------------
$!
$ SUBSTLOOP:
$ if f$locate("/",PARSED_LINE) .ne. f$length(PARSED_LINE)
$ then
$ PARSED_LINE = f$extract(0,f$locate("/",PARSED_LINE),PARSED_LINE) +
"§" + -
f$extract(f$locate("/",PARSED_LINE)+1,f
$length(PARSED_LINE),PARSED_LINE)
$ else
$ goto SUBSTEND
$ endif
$ goto SUBSTLOOP
$!
$ SUBSTEND:
$!
$!---------------------------------------------------------
$!
$ PCOUNT = 0
$ PARSE_LINE:
$ PARAM = f$extract(0,f$locate("§",PARSED_LINE)+1,PARSED_LINE)
$ PCOUNT = PCOUNT + 1
$ P'PCOUNT' = PARAM - "§"
$ if PARAM .eqs. "" then PARAM = PARSED_LINE
$ PARSED_LINE = PARSED_LINE - PARAM
$ if f$length(PARSED_LINE) .gt. 0 then goto PARSE_LINE
$!
$!---------------------------------------------------------
$!
$ if f$locate(":",P3) .eq. f$length(P3)-1 then -
P3 = f$extract(0,f$locate(":",P3),P3)
$ if f$locate(":",P3) .eq. f$length(P3)-1 then -
P3 = f$extract(0,f$locate(":",P3),P3)
$ if P3 .eqs. "0" then P3 = "''f$trnlnm("SYS$NODE")'" - "::"
$!
$ if P1 .eqs. "." then P1 = f$extract(0,2,f$process()) + "*"
$ if P2 .eqs. "." then P2 = f$getjpi("","USERNAME")
$ if P3 .eqs. "." then P3 = "''f$trnlnm("SYS$NODE")'" - "::"
$ if P4 .eqs. "." then P4 = "JOB=DETACHED"
$ if P6 .eqs. "." then P6 = "STATE=HIB"
$!
$ if P1 .eqs. "=" then P1 = f$extract(0,2,f$process()) + "*"
$ if P2 .eqs. "=" then P2 = f$getjpi("","USERNAME")
$ if P3 .eqs. "=" then P3 = "''f$trnlnm("SYS$NODE")'" - "::"
$ if P4 .eqs. "=" then P4 = "JOB=DETACHED"
$ if P6 .eqs. "=" then P6 = "STATE=HIB"
$!
$ if P1 .eqs. "<>" then P1 = "PROC<>''f$extract(0,2,f$process())'" +
"*"
$ if P2 .eqs. "<>" then P2 = "USER<>''f$getjpi("","USERNAME")'"
$ if P3 .eqs. "<>" then P3 = "NODE<>''f$trnlnm("SYS$NODE")'" - "::"
$ if P4 .eqs. "<>" then P4 = "JOB<>DETACHED"
$ if P6 .eqs. "<>" then P6 = "STATE<>HIB"
$!
$ if (P5 .eqs. ".") .or. (P5 .eqs. "=")
$ then
$ P5 = f$parse(f$trnlnm("SYS$DISK"),,,,"NO_CONCEAL")
$ P5 = P5 - ".;" - "][" - "][" - "><" - "><"
$ if f$locate("<",P5) .ne. f$length(P5)
$ then
$ P5 = f$extract(0,f$locate("<",P5),P5) + "[" + -
f$extract(f$locate("<",P5)+1,f$length(P5),P5)
$ endif
$ if f$locate(">",P5) .ne. f$length(P5)
$ then
$ P5 = f$extract(0,f$locate(">",P5),P5) + "]" + -
f$extract(f$locate(">",P5)+1,f$length(P5),P5)
$ endif
$ P5 = P5 - "][" - "][" - "><" - "><"
$ P5 = "IMAGE=''P5'"
$ endif
$ if P5 .eqs. "<>"
$ then
$ P5 = f$parse(f$trnlnm("SYS$DISK"),,,,"NO_CONCEAL")
$ P5 = P5 - ".;" - "][" - "][" - "><" - "><"
$ if f$locate("<",P5) .ne. f$length(P5)
$ then
$ P5 = f$extract(0,f$locate("<",P5),P5) + "[" + -
f$extract(f$locate("<",P5)+1,f$length(P5),P5)
$ endif
$ if f$locate(">",P5) .ne. f$length(P5)
$ then
$ P5 = f$extract(0,f$locate(">",P5),P5) + "]" + -
f$extract(f$locate(">",P5)+1,f$length(P5),P5)
$ endif
$ P5 = P5 - "][" - "][" - "><" - "><"
$ P5 = "IMAGE<>''P5'"
$ endif
$!
$! initialize qualifier flags affecting scanning behavior
$ check_quotas = FALSE ! if TRUE means CHECK parameter is being
used
$ display_symbols = FALSE ! if TRUE then JPI_* symbol values are
displayed
$ first_display = FALSE ! if TRUE means to search only for first
match
$ quiet_display = FALSE ! if TRUE means do not display processes
found
$ reloop_OK = TRUE ! if TRUE then continuous reloop thru JPI
context
$ continuous_display = FALSE ! if TRUE then display loops through JPI
context
$ wait_display = FALSE ! if TRUE then looping must pause at full
screen
$ down_stop = FALSE ! if TRUE then continuous display stops
when
$! up/down status changes
$!
$!check if a continuos display and wait time is desired
$ if (f$extract(0,4,P1) .eqs. "CONT") .OR. (f$extract(0,5,P1) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P1) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P1)+1,f$length(P1),P1)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P1) .ne. f$length(P1))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P1 = ""
$ endif
$ if (f$extract(0,4,P2) .eqs. "CONT") .OR. (f$extract(0,5,P2) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P2) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P2)+1,f$length(P2),P2)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P2) .ne. f$length(P2))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P2 = ""
$ endif
$ if (f$extract(0,4,P3) .eqs. "CONT") .OR. (f$extract(0,5,P3) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P3) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P3)+1,f$length(P3),P3)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P3) .ne. f$length(P3))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P3 = ""
$ endif
$ if (f$extract(0,4,P4) .eqs. "CONT") .OR. (f$extract(0,5,P4) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P4) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P4)+1,f$length(P4),P4)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P4) .ne. f$length(P4))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P4 = ""
$ endif
$ if (f$extract(0,4,P5) .eqs. "CONT") .OR. (f$extract(0,5,P5) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P5) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P5)+1,f$length(P5),P5)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P5) .ne. f$length(P5))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P5 = ""
$ endif
$ if (f$extract(0,4,P6) .eqs. "CONT") .OR. (f$extract(0,5,P6) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P6) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P6)+1,f$length(P6),P6)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P6) .ne. f$length(P6))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P6 = ""
$ endif
$ if (f$extract(0,4,P7) .eqs. "CONT") .OR. (f$extract(0,5,P7) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P7) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P7)+1,f$length(P7),P7)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P7) .ne. f$length(P7))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P7 = ""
$ endif
$ if (f$extract(0,4,P8) .eqs. "CONT") .OR. (f$extract(0,5,P8) .eqs.
"DSTOP")
$ then
$ continuous_display = TRUE
$ if (f$extract(0,5,P8) .eqs. "DSTOP") then down_stop = TRUE
$ wait_display = TRUE
$ wait_time = f$extract(f$locate("=",P8)+1,f$length(P8),P8)
$ if wait_time .eqs. ""
$ then
$ if (f$locate("=",P8) .ne. f$length(P8))
$ then
$ wait_time = "00:00:00.00"
$ else
$ wait_time = default_wait_time
$ endif
$ endif
$ P8 = ""
$ endif
$ if wait_display
$ then
$ wait_time = f$cvtime(wait_time,"DELTA")
$ if .not. $status then goto quitit
$ endif
$!
$!
$!check for explicit search qualifiers
$!
$!initialize variables
$ OP1 = ""
$ OP2 = ""
$ OP3 = ""
$ OP4 = ""
$ OP5 = ""
$ OP6 = ""
$ OP7 = ""
$ OP8 = ""
$ OP9 = ""
$ ITEM1 = ""
$ ITEM2 = ""
$ ITEM3 = ""
$ ITEM4 = ""
$ ITEM5 = ""
$ ITEM6 = ""
$ ITEM7 = ""
$ ITEM8 = ""
$ ITEM9 = ""
$ VAL1 = ""
$ VAL2 = ""
$ VAL3 = ""
$ VAL4 = ""
$ VAL5 = ""
$ VAL6 = ""
$ VAL7 = ""
$ VAL8 = ""
$ VAL9 = ""
$ Pdex = 0
$!
$ PdexLOOP1:
$ Pdex = Pdex + 1
$!
$ if Pdex .gt. 9 then goto PdexEND1
$!
$ if P'Pdex' .eqs. "CHECK" then P'Pdex' = "CHECK="
$ if P'Pdex' .eqs. "PERCENT" then P'Pdex' = "PERCENT="
$!
$ if (f$locate("><",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "ANY"
$ ITEM'Pdex' = f$extract(0,f$locate(">",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate("<",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate("<>",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "NEQ"
$ ITEM'Pdex' = f$extract(0,f$locate("<",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate(">",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate("<=",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "LEQ"
$ ITEM'Pdex' = f$extract(0,f$locate("<",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate("=",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate(">=",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "GEQ"
$ ITEM'Pdex' = f$extract(0,f$locate(">",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate("=",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate("<",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "LSS"
$ ITEM'Pdex' = f$extract(0,f$locate("<",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate("<",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate(">",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "GTR"
$ ITEM'Pdex' = f$extract(0,f$locate(">",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate(">",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate("==",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "ALL"
$ ITEM'Pdex' = f$extract(0,f$locate("=",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate("=",P'Pdex')+2,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if (f$locate("=",P'Pdex') .ne. f$length(P'Pdex'))
$ then
$ OP'Pdex' = "EQL"
$ ITEM'Pdex' = f$extract(0,f$locate("=",P'Pdex'),P'Pdex')
$ VAL'Pdex' = f$extract(f$locate("=",P'Pdex')+1,f
$length(P'Pdex'),P'Pdex')
$ P'Pdex' = ""
$ endif
$!
$ if ITEM'Pdex' .eqs. "CHECK"
$ then
$ check_quotas = TRUE
$ display_symbols = TRUE
$ if VAL'Pdex' .eqs. "" then VAL'Pdex' = "PGFLQUOTA"
$ check_item = VAL'Pdex'
$ check_item = check_item - "LM" - "CNT"
$ endif
$!
$ if ITEM'Pdex' .eqs. "PERCENT"
$ then
$ if VAL'Pdex' .eqs. "" then VAL'Pdex' = 0
$ percent = VAL'Pdex'
$ if f$type(percent) .ne. "INTEGER" then goto percenterr
$ if percent .gt. 100 then goto percenterr
$ if percent .lt. 0 then goto percenterr
$ endif
$!
$ if ITEM'Pdex' .eqs. "PROC" then ITEM'Pdex' = "PRCNAM"
$ if ITEM'Pdex' .eqs. "PROCESS" then ITEM'Pdex' = "PRCNAM"
$ if ITEM'Pdex' .eqs. "PROCNAM" then ITEM'Pdex' = "PRCNAM"
$ if ITEM'Pdex' .eqs. "PRCNAM" then P1 = "*"
$!
$ if ITEM'Pdex' .eqs. "USER" then ITEM'Pdex' = "USERNAME"
$ if ITEM'Pdex' .eqs. "USERNAME" then P2 = "*"
$!
$ if ITEM'Pdex' .eqs. "NODE" then ITEM'Pdex' = "NODENAME"
$ if (ITEM'Pdex' .eqs. "NODENAME") .and. (OP'Pdex' .eqs. "EQL")
$ then
$ if (Pdex .ne. 3)
$ then
$ P3 = VAL'Pdex'+",''P3'"
$ else
$ P3 = VAL'Pdex'
$ endif
$ OP'Pdex' = ""
$ ITEM'Pdex' = ""
$ VAL'Pdex' = ""
$ else
$ if ITEM'Pdex' .eqs. "NODENAME" then P3 = "CANCELLED"
$ endif
$!
$ if ITEM'Pdex' .eqs. "JOB" then ITEM'Pdex' = "JOBTYPE"
$ if ITEM'Pdex' .eqs. "JOBTYP" then ITEM'Pdex' = "JOBTYPE"
$ if ITEM'Pdex' .eqs. "JOBTYPE" then P4 = "*"
$!
$ if ITEM'Pdex' .eqs. "STATE" then P6 = "*"
$!
$ if ITEM'Pdex' .eqs. "ACCNT" then ITEM'Pdex' = "ACCOUNT"
$ if ITEM'Pdex' .eqs. "AUTH" then ITEM'Pdex' = "AUTHPRI"
$ if ITEM'Pdex' .eqs. "CUR" then ITEM'Pdex' = "CURPRIV"
$ if ITEM'Pdex' .eqs. "GROUP" then ITEM'Pdex' = "GRP"
$ if ITEM'Pdex' .eqs. "HWMODEL" then ITEM'Pdex' = "HW_MODEL"
$ if ITEM'Pdex' .eqs. "MODEL" then ITEM'Pdex' = "HW_MODEL"
$ if ITEM'Pdex' .eqs. "MOD" then ITEM'Pdex' = "HW_MODEL"
$ if ITEM'Pdex' .eqs. "HW" then ITEM'Pdex' = "HW_NAME"
$ if ITEM'Pdex' .eqs. "HWNAME" then ITEM'Pdex' = "HW_NAME"
$ if ITEM'Pdex' .eqs. "JOBCNT" then ITEM'Pdex' = "JOBPRCCNT"
$ if ITEM'Pdex' .eqs. "MASTER" then ITEM'Pdex' = "MASTER_PID"
$ if ITEM'Pdex' .eqs. "MBR" then ITEM'Pdex' = "MEM"
$ if ITEM'Pdex' .eqs. "MEMB" then ITEM'Pdex' = "MEM"
$ if ITEM'Pdex' .eqs. "MEMBER" then ITEM'Pdex' = "MEM"
$ if ITEM'Pdex' .eqs. "MOD" then ITEM'Pdex' = "MODE"
$ if ITEM'Pdex' .eqs. "CSID" then ITEM'Pdex' = "NODE_CSID"
$ if ITEM'Pdex' .eqs. "OWN" then ITEM'Pdex' = "OWNER"
$ if ITEM'Pdex' .eqs. "PROCCNT" then ITEM'Pdex' = "PRCCNT"
$ if ITEM'Pdex' .eqs. "COUNT" then ITEM'Pdex' = "PRCCNT"
$ if ITEM'Pdex' .eqs. "PRIO" then ITEM'Pdex' = "PRI"
$ if ITEM'Pdex' .eqs. "PRIORITY" then ITEM'Pdex' = "PRI"
$ if ITEM'Pdex' .eqs. "BASE" then ITEM'Pdex' = "PRIB"
$ if ITEM'Pdex' .eqs. "STATUS" then ITEM'Pdex' = "STS"
$ if ITEM'Pdex' .eqs. "TERM" then ITEM'Pdex' = "TERMINAL"
$ if ITEM'Pdex' .eqs. "UIC" then ITEM'Pdex' = "UIC"
$ if ITEM'Pdex' .eqs. "PID"
$ then
$ P1 = VAL'Pdex'
$ OP'Pdex' = ""
$ ITEM'Pdex' = ""
$ VAL'Pdex' = ""
$ endif
$ if ITEM'Pdex' .eqs. "IMAG" then ITEM'Pdex' = "IMAGE"
$ if ITEM'Pdex' .eqs. "IMAGNAM" then ITEM'Pdex' = "IMAGE"
$ if ITEM'Pdex' .eqs. "IMAGNAME" then ITEM'Pdex' = "IMAGE"
$ if (ITEM'Pdex' .eqs. "IMAGE")
$ then
$ if (OP'Pdex' .nes. "NEQ")
$ then
$ P5 = "ISDEF" + VAL'Pdex'
$ img = VAL'Pdex'
$ OP'Pdex' = ""
$ ITEM'Pdex' = ""
$ VAL'Pdex' = ""
$ else
$ P5 = "NOTDEF" + VAL'Pdex'
$ img = VAL'Pdex'
$ OP'Pdex' = ""
$ ITEM'Pdex' = ""
$ VAL'Pdex' = ""
$ endif
$ endif
$!
$ goto PdexLOOP1
$ PdexEND1:
$!
$!check if a quiet display is desired
$ if (f$extract(0,5,P1) .eqs. "QUIET")
$ then
$ P1 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P2) .eqs. "QUIET")
$ then
$ P2 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P3) .eqs. "QUIET")
$ then
$ P3 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P4) .eqs. "QUIET")
$ then
$ P4 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P5) .eqs. "QUIET")
$ then
$ P5 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P6) .eqs. "QUIET")
$ then
$ P6 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P7) .eqs. "QUIET")
$ then
$ P7 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$ if (f$extract(0,5,P8) .eqs. "QUIET")
$ then
$ P8 = ""
$ quiet_display = TRUE
$ continuous_display = FALSE
$ endif
$!
$ if quiet_display .eq. 1 then ASSIGN/SUPERVISOR_MODE NL: SYS$OUTPUT
$!
$!check if paging is desired
$ page_display = FALSE
$ if (f$extract(0,4,P1) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P1 = ""
$ endif
$ if (f$extract(0,4,P2) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P2 = ""
$ endif
$ if (f$extract(0,4,P3) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P3 = ""
$ endif
$ if (f$extract(0,4,P4) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P4 = ""
$ endif
$ if (f$extract(0,4,P5) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P5 = ""
$ endif
$ if (f$extract(0,4,P6) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P6 = ""
$ endif
$ if (f$extract(0,4,P7) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P7 = ""
$ endif
$ if (f$extract(0,4,P8) .eqs. "PAGE")
$ then
$ page_display = TRUE
$ P8 = ""
$ endif
$!
$!check if warning BELL is desired
$ if ((f$extract(0,4,P1) .eqs. "BELL") .AND. (f$mode() .nes.
"BATCH"))
$ then
$ P1 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P2) .eqs. "BELL")
$ then
$ P2 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P3) .eqs. "BELL")
$ then
$ P3 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P4) .eqs. "BELL")
$ then
$ P4 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P5) .eqs. "BELL")
$ then
$ P5 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P6) .eqs. "BELL")
$ then
$ P6 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P7) .eqs. "BELL")
$ then
$ P7 = ""
$ BELL[0,8] = 7
$ endif
$ if (f$extract(0,4,P8) .eqs. "BELL")
$ then
$ P8 = ""
$ BELL[0,8] = 7
$ endif
$!
$!check if only first process is desired
$ if (f$extract(0,5,P1) .eqs. "FIRST")
$ then
$ P1 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P2) .eqs. "FIRST")
$ then
$ P2 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P3) .eqs. "FIRST")
$ then
$ P3 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P4) .eqs. "FIRST")
$ then
$ P4 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P5) .eqs. "FIRST")
$ then
$ P5 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P6) .eqs. "FIRST")
$ then
$ P6 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P7) .eqs. "FIRST")
$ then
$ P7 = ""
$ first_display = TRUE
$ endif
$ if (f$extract(0,5,P8) .eqs. "FIRST")
$ then
$ P8 = ""
$ first_display = TRUE
$ endif
$!
$! go to help
$ if P1 .eqs. "?" then GOTO INFO
$!
$! set flag for extended JPI_ Symbol output
$ if (P7 + P8 .nes. "") then display_symbols = TRUE
$!
$! assign parameters to variables
$ procname = f$extract(0,1,P1)
$ if f$type(procname) .eqs. "INTEGER"
$ then
$ procname = f$edit(f$getjpi(P1,"prcnam"),"TRIM")
$ else
$ procname = P1
$ endif
$ user = P2
$ node = P3
$ jobtyp = P4
$!
$ image = P5
$ if img .eqs. ""
$ then
$ img = image
$ endif
$ if img .eqs. "" then img = "*"
$ imgprt = "i=''img'"
$!
$ state = P6
$ if P6 .eqs. "" then state = "*"
$ down_count = 0
$ up_count = 0
$!
$ if procname .eqs. "" then procname = "*"
$ if procname .eqs. "all" then procname = "*"
$ if procname .eqs. "ALL" then procname = "*"
$ if user .eqs. "all" then user = "*"
$ if user .eqs. "ALL" then user = "*"
$ if user .eqs. "" then user = "*"
$ if .not. (F$PRIVILEGE("WORLD") .or. F$PRIVILEGE("GROUP"))
$ then
$ user = "''f$getjpi("","USERNAME")'"
$ endif
$ if (F$PRIVILEGE("GROUP") .and. -
(.not. F$PRIVILEGE("WORLD")) .and. (user .eqs. "*"))
$ then
$ usr = "''f$user()'"
$ if f$locate(",",usr) .ne. f$length(usr) then -
usr = "''f$extract(0,f$locate(",",usr)+1,usr)'" + "*]"
$ else
$ usr = user
$ endif
$!
$! if node parameter is empty, then find current node
$ if node .eqs. "" then node = f$trnlnm("SYS$NODE")
$ pos = f$locate(":",node)
$ node = f$extract(0,pos,node)
$!
$ isIDLE = FALSE
$ isNOTIDLE = FALSE
$ if (f$extract(0,4,image) .eqs. "IDLE") .or. -
(f$extract(0,4,image) .eqs. "idle")
$ then
$ image = ""
$ isIDLE = TRUE
$ imgprt = "i=IDLE"
$ endif
$ if (f$extract(0,4,image) .eqs. "BUSY") .or. -
(f$extract(0,4,image) .eqs. "busy")
$ then
$ image = ""
$ isNOTIDLE = TRUE
$ imgprt = "i=BUSY"
$ endif
$!
$ isDEFAULT = FALSE
$ isNOTDEFAULT = FALSE
$ if (f$extract(0,5,image) .eqs. "ISDEF") .or. -
(f$extract(0,5,image) .eqs. "isdef")
$ then
$ image = f$extract(5,f$length(image),image)
$ isNOTIDLE = TRUE
$ isDEFAULT = TRUE
$ imgprt = "i=DEFAULT"
$ endif
$ if (f$extract(0,6,image) .eqs. "NOTDEF") .or. -
(f$extract(0,6,image) .eqs. "notdef")
$ then
$ image = f$extract(6,f$length(image),image)
$ isNOTIDLE = TRUE
$ isNOTDEFAULT = TRUE
$ imgprt = "i<>DEFAULT"
$ endif
$ if image .eqs. "*" then imgprt = "i=*"
$ if image .eqs. "*" then image = ""
$!
$!convert jobtype parameter to full jobtype name
$ if jobtyp .eqs. "" then jobtyp = "*"
$ if jobtyp .eqs. "0" then jobtyp = "DETACHED"
$ if jobtyp .eqs. "1" then jobtyp = "NETWORK"
$ if jobtyp .eqs. "2" then jobtyp = "BATCH"
$ if jobtyp .eqs. "3" then jobtyp = "LOCAL"
$ if jobtyp .eqs. "4" then jobtyp = "DIALUP"
$ if jobtyp .eqs. "5" then jobtyp = "REMOTE"
$!
$ LINE_PARAMETERS := -
"p=''procname' u=''usr' n=''node' j=''jobtyp' ''imgprt' s=''state'
" -
"''P7' ''P8' ''P9'"
$!
$ LPdex = 1
$ LPLOOP:
$ LPITEM = ITEM'LPdex'
$ REDUCE = "USERNAME,AUTHPRI,TERMINAL"
$ if f$locate(LPITEM,REDUCE) .nes. f$length(REDUCE) then -
LPITEM = f$extract(0,4,LPITEM)
$ if LPITEM .eqs. "MASTER_PID" then LPITEM = "MASTER"
$ if LPITEM .eqs. "ACCOUNT" then LPITEM = "ACCNT"
$ IF OP'LPdex' .eqs. "ANY" then LPOP = "><"
$ IF OP'LPdex' .eqs. "NEQ" then LPOP = "<>"
$ IF OP'LPdex' .eqs. "LEQ" then LPOP = "<="
$ IF OP'LPdex' .eqs. "GEQ" then LPOP = ">="
$ IF OP'LPdex' .eqs. "LSS" then LPOP = "<"
$ IF OP'LPdex' .eqs. "GTR" then LPOP = ">"
$ IF OP'LPdex' .eqs. "ALL" then LPOP = "=="
$ IF OP'LPdex' .eqs. "EQL" then LPOP = "="
$ IF OP'LPdex' .eqs. "" then LPOP = ""
$ LPVAR = LPITEM + LPOP + VAL'LPdex'
$ if LPVAR .nes. "" then LINE_PARAMETERS := "''LINE_PARAMETERS'
''LPVAR'"
$ LPdex = LPdex + 1
$ if LPdex .lt. 9 then goto LPLOOP
$ LINE_PARAMETERS := "''f$edit(LINE_PARAMETERS,"COMPRESS,TRIM")'"
$!
$ write sys$output ESline," "
$ if continuous_display then SAY ES
$ if .not. continuous_display then TOP = NEXTLINE
$!
$ if P7 .nes. ""
$ then
$ param = P7
$ gosub paramcount
$ endif
$!
$ if P8 .nes. ""
$ then
$ param = P8
$ gosub paramcount
$ endif
$!
$ if check_quotas
$ then
$ if (check_item .eqs. "PRC")
$ then
$ symbolcnt = symbolcnt + 3
$ goto ifcheck1
$ endif
$ if (check_item .eqs. "PGFLQUOTA")
$ then
$ symbolcnt = symbolcnt + 2
$ goto ifcheck1
$ endif
$ param = check_item+"CNT"
$ gosub paramcount
$ param = check_item+"LM"
$ gosub paramcount
$ endif
$ ifcheck1:
$!
$ if display_symbols .and. page_display
$ then
$ TOP = NEXTLINE
$ current_term_height = max_linecount
$ if f$mode() .nes. "BATCH" then set term /
page='current_term_height'
$ er
$ endif
$!
$ STARTIT:
$!define process search context
$!
$ Pdex = 0
$ PdexLOOP2:
$ Pdex = Pdex + 1
$ if Pdex .gt. 9 then goto PdexEND2
$ if ITEM'Pdex' .eqs. "CHECK" then goto PdexLOOP2
$ if ITEM'Pdex' .eqs. "PERCENT" then goto PdexLOOP2
$ if OP'Pdex' .nes. "" then -
a = f$context("process",proc_context,ITEM'Pdex',VAL'Pdex',OP'Pdex')
$ if .not. $STATUS then goto abortit
$ goto PdexLOOP2
$ PdexEND2:
$!
$ if node .nes. "CANCELLED" then -
a = f$context("process",proc_context,"nodename",node,"eql")
$ if jobtyp .nes. "*" then -
a = f$context("process",proc_context,"jobtype",jobtyp,"eql")
$ if state .nes. "*" then -
a = f$context("process",proc_context,"state",state,"eql")
$ if user .nes. "*" then -
a = f$context("process",proc_context,"username",user,"eql")
$ if procname .nes. "*" then -
a = f$context("process",proc_context,"prcnam",procname,"eql")
$!
$!take first step into process search context
$ pid = f$pid(proc_context)
$ if pid .eqs. ""
$ then
$ if up_count .gt. down_count
$ then
$ SAY ONEUP,BELL,BELL,BELL,BELL
$ down_count = down_count + 1
$ if down_stop then goto abortit
$ endif
$ goto notfound
$ else
$ if up_count .eq. down_count
$ then
$ IF up_count .gt. 0 then SAY ONEUP,BELL,BELL
$ up_count = up_count + 1
$ endif
$ endif
$!
$ gosub displayheader
$!
$ context_loop:
$! get process information...
$ on error then goto param_err
$!
$! data for the /continuous default output
$ JPI_PID = pid
$ JPI_TIME=f$time()
$ JPI_NODENAME=f$edit(f$getjpi(pid,"nodename"),"TRIM")
$ JPI_PRCNAM=f$edit(f$getjpi(pid,"prcnam"),"TRIM")
$ NODE_PROC = F$FAO("!(#AS) !(#AS)",6,JPI_NODENAME,15,JPI_PRCNAM)
$ JPI_USERNAME=f$edit(f$getjpi(pid,"username"),"TRIM")
$ JPI_STATE=f$getjpi(pid,"STATE")
$ JPI_PRI=f$string(f$getjpi(pid,"PRI"))
$ JPI_JOBTYPE=f$getjpi(pid,"JOBTYPE")
$ JPI_IMAGNAME=f$getjpi(pid,"imagname")
$ JPI_IMAGNAME=JPI_IMAGNAME - "][" - "]["
$ JPI_DIRIO=f$string(f$getjpi(pid,"DIRIO"))
$ JPI_BUFIO=f$string(f$getjpi(pid,"BUFIO"))
$ JPI_ALLIO= F$INTEGER(JPI_DIRIO) + F$INTEGER(JPI_BUFIO)
$ JPI_ALLIO= "''JPI_ALLIO'"
$ JPI_PAGEFLTS=f$string(f$getjpi(pid,"PAGEFLTS"))
$ JPI_CPUTIM=f$string(f$getjpi(pid,"CPUTIM"))
$ CPUHRS = JPI_CPUTIM / 360000
$ CPUMIN = (JPI_CPUTIM - (CPUHRS * 360000)) / 6000
$ CPUSEC = (JPI_CPUTIM - (CPUHRS * 360000) - (CPUMIN * 6000)) /100
$ CPUMILL = (JPI_CPUTIM - (CPUHRS * 360000) - (CPUMIN * 6000) -
- (CPUSEC * 100))
$ if f$length(CPUHRS) .lt. 2 then CPUHRS = " " + "''CPUHRS'"
$ if f$length(CPUMIN) .lt. 2 then CPUMIN = "0" + "''CPUMIN'"
$ if f$length(CPUSEC) .lt. 2 then CPUSEC = "0" + "''CPUSEC'"
$ if f$length(CPUMILL) .lt. 2 then CPUMILL = "0" + "''CPUMILL'"
$ JPI_CPUTIM = "''CPUHRS'" + ":" + "" + "''CPUMIN'" + ":" -
+ "''CPUSEC'" + "." + "''CPUMILL'"
$ JPI_IMAGE= -
"''f$parse(f$getjpi (pid,"imagname"),,,"NAME")'" + -
"''f$parse(f$getjpi (pid,"imagname"),,,"TYPE")'"

$ JPI_IMAGE = JPI_IMAGE - "][" - "][" - "><" - "><"
$ if f$locate("<",JPI_IMAGE) .ne. f$length(JPI_IMAGE)
$ then
$ JPI_IMAGE = f$extract(0,f$locate("<",JPI_IMAGE),JPI_IMAGE) +
"[" + -
f$extract(f$locate("<",JPI_IMAGE)+1,f
$length(JPI_IMAGE),JPI_IMAGE)
$ endif
$ if f$locate(">",JPI_IMAGE) .ne. f$length(JPI_IMAGE)
$ then
$ JPI_IMAGE = f$extract(0,f$locate(">",JPI_IMAGE),JPI_IMAGE) +
"]" + -
f$extract(f$locate(">",JPI_IMAGE)+1,f
$length(JPI_IMAGE),JPI_IMAGE)
$ endif
$ JPI_IMAGE = JPI_IMAGE - "][" - "][" - "><" - "><"
$ if jpi_imagname .eqs. "" then jpi_image = "---idle---"
$ if ((isIDLE) .and. (JPI_IMAGE .nes. "---idle---")) then goto skipit
$ if ((isNOTIDLE) .and. (JPI_IMAGE .eqs. "---idle---")) then goto
skipit
$ if (image .nes. "")
$ then
$ if (isNOTDEFAULT)
$ then
$ if F$LOCATE(image,JPI_IMAGNAME) .ne. -
F$LENGTH(JPI_IMAGNAME) then goto skipit
$ else
$ if F$LOCATE(image,JPI_IMAGNAME) .eq. -
F$LENGTH(JPI_IMAGNAME) then goto skipit
$ endif
$ endif
$ NODE_USER_PROC = F$FAO("!(#AS) !(#AS) !(#AS)",6,JPI_NODENAME, -
12,JPI_USERNAME,15,JPI_PRCNAM)
$!
$ if JPI_JOBTYPE .eqs. "0" then JPI_JOBTYPE = "DETACHED"
$ if JPI_JOBTYPE .eqs. "1" then JPI_JOBTYPE = "NETWORK"
$ if JPI_JOBTYPE .eqs. "2" then JPI_JOBTYPE = "BATCH"
$ if JPI_JOBTYPE .eqs. "3" then JPI_JOBTYPE = "LOCAL"
$ if JPI_JOBTYPE .eqs. "4" then JPI_JOBTYPE = "DIALUP"
$ if JPI_JOBTYPE .eqs. "5" then JPI_JOBTYPE = "REMOTE"
$!
$ if (.not. display_symbols) .and. continuous_display then goto
showit
$!
$! additional variables which can be checked if requested
$ if display_symbols
$ then
$ JPI_ACCOUNT=f$getjpi(pid,"ACCOUNT")
$ JPI_APTCNT=f$getjpi(pid,"APTCNT")
$ JPI_ASTACT=f$getjpi(pid,"ASTACT")
$ JPI_ASTCNT=f$getjpi(pid,"ASTCNT")
$ JPI_ASTEN=f$getjpi(pid,"ASTEN")
$ JPI_ASTLM=f$getjpi(pid,"ASTLM")
$ JPI_AUTHPRI=f$getjpi(pid,"AUTHPRI")
$ JPI_AUTHPRIV=f$getjpi(pid,"AUTHPRIV")
$ JPI_BIOCNT=f$getjpi(pid,"BIOCNT")
$ JPI_BIOLM=f$getjpi(pid,"BIOLM")
$ JPI_BYTCNT=f$getjpi(pid,"BYTCNT")
$ JPI_BYTLM=f$getjpi(pid,"BYTLM")
$ JPI_CLINAME=f$getjpi(pid,"CLINAME")
$ JPI_CPULIM=f$getjpi(pid,"CPULIM")
$ JPI_CURPRIV=f$getjpi(pid,"CURPRIV")
$ JPI_DFPFC=f$getjpi(pid,"DFPFC")
$ JPI_DFWSCNT=f$getjpi(pid,"DFWSCNT")
$ JPI_DIOCNT=f$getjpi(pid,"DIOCNT")
$ JPI_DIOLM=f$getjpi(pid,"DIOLM")
$ JPI_EFCS=f$getjpi(pid,"EFCS")
$ JPI_EFCU=f$getjpi(pid,"EFCU")
$ JPI_EFWM=f$getjpi(pid,"EFWM")
$ JPI_ENQCNT=f$getjpi(pid,"ENQCNT")
$ JPI_ENQLM=f$getjpi(pid,"ENQLM")
$ JPI_FILCNT=f$getjpi(pid,"FILCNT")
$ JPI_FILLM=f$getjpi(pid,"FILLM")
$ JPI_FREP0VA=f$getjpi(pid,"FREP0VA")
$ JPI_FREP1VA=f$getjpi(pid,"FREP1VA")
$ JPI_FREPTECNT=f$getjpi(pid,"FREPTECNT")
$ JPI_GPGCNT=f$getjpi(pid,"GPGCNT")
$ JPI_GRP=f$getjpi(pid,"GRP")
$ JPI_IMAGECOUNT=f$getjpi(pid,"IMAGECOUNT")
$ JPI_IMAGPRIV=f$getjpi(pid,"IMAGPRIV")
$ JPI_JOBPRCCNT=f$getjpi(pid,"JOBPRCCNT")
$ JPI_LAST_LOGIN_I=f$getjpi(pid,"LAST_LOGIN_I")
$ JPI_LAST_LOGIN_N=f$getjpi(pid,"LAST_LOGIN_N")
$ JPI_LOGIN_FAILURES=f$getjpi(pid,"LOGIN_FAILURES")
$ JPI_LOGIN_FLAGS=f$getjpi(pid,"LOGIN_FLAGS")
$ JPI_LOGINTIM=f$getjpi(pid,"LOGINTIM")
$ JPI_MASTER_PID=f$getjpi(pid,"MASTER_PID")
$ JPI_MAXDETACH=f$getjpi(pid,"MAXDETACH")
$ JPI_MAXJOBS=f$getjpi(pid,"MAXJOBS")
$ JPI_MEM=f$getjpi(pid,"MEM")
$ JPI_MODE=f$getjpi(pid,"MODE")
$ JPI_MSGMASK=f$getjpi(pid,"MSGMASK")
$ JPI_NODE_CSID=f$edit(f$getjpi(pid,"NODE_CSID"),"TRIM")
$ JPI_NODE_VERSION=f$edit(f$getjpi(pid,"NODE_VERSION"),"TRIM")
$ JPI_OWNER=f$edit(f$getjpi(pid,"OWNER"),"TRIM")
$ JPI_PAGFILCNT=f$getjpi(pid,"PAGFILCNT")
$ JPI_PAGFILLOC=f$getjpi(pid,"PAGFILLOC")
$ JPI_PGFLQUOTA=f$getjpi(pid,"PGFLQUOTA")
$ JPI_PHDFLAGS=f$getjpi(pid,"PHDFLAGS")
$ JPI_PPGCNT=f$getjpi(pid,"PPGCNT")
$ JPI_PRCCNT=f$getjpi(pid,"PRCCNT")
$ JPI_PRCLM=f$getjpi(pid,"PRCLM")
$ JPI_PRIB=f$getjpi(pid,"PRIB")
$ JPI_PROC_INDEX=f$getjpi(pid,"PROC_INDEX")
$ JPI_PROCPRIV=f$getjpi(pid,"PROCPRIV")
$ JPI_SHRFILLM=f$getjpi(pid,"SHRFILLM")
$ JPI_SITESPEC=f$getjpi(pid,"SITESPEC")
$ JPI_STS=f$getjpi(pid,"STS")
$ JPI_STS2=f$getjpi(pid,"STS2")
$ JPI_SWPFILLOC=f$getjpi(pid,"SWPFILLOC")
$ JPI_TABLENAME=f$getjpi(pid,"TABLENAME")
$ JPI_TERMINAL=f$getjpi(pid,"TERMINAL")
$ JPI_TMBU=f$getjpi(pid,"TMBU")
$ JPI_TQCNT=f$getjpi(pid,"TQCNT")
$ JPI_TQLM=f$getjpi(pid,"TQLM")
$ JPI_TT_ACCPORNAM=f$getjpi(pid,"TT_ACCPORNAM")
$ JPI_TT_PHYDEVNAM=f$getjpi(pid,"TT_PHYDEVNAM")
$ JPI_UAF_FLAGS=f$getjpi(pid,"UAF_FLAGS")
$ JPI_UIC=f$getjpi(pid,"UIC")
$ JPI_VIRTPEAK=f$getjpi(pid,"VIRTPEAK")
$ JPI_VOLUMES=f$getjpi(pid,"VOLUMES")
$ JPI_WSAUTH=f$getjpi(pid,"WSAUTH")
$ JPI_WSAUTHEXT=f$getjpi(pid,"WSAUTHEXT")
$ JPI_WSEXTENT=f$getjpi(pid,"WSEXTENT")
$ JPI_WSPEAK=f$getjpi(pid,"WSPEAK")
$ JPI_WSQUOTA=f$getjpi(pid,"WSQUOTA")
$ JPI_WSSIZE=f$getjpi(pid,"WSSIZE")
$!
$! these variables performed last, since they are most likely to fail
$ JPI_SYSTEM_RIGHTS=f$getjpi(pid,"SYSTEM_RIGHTS")
$ JPI_PROCESS_RIGHTS=f$getjpi(pid,"PROCESS_RIGHTS")
$ JPI_RIGHTSLIST=f$getjpi(pid,"RIGHTSLIST")
$!
$ endif !***if (display_symbols)***
$!
$ if check_quotas
$ then
$ if JPI_PRCNAM .eqs. "SWAPPER" then goto skipit
$ if check_item .eqs. "PGFLQUOTA"
$ then
$ if JPI_VIRTPEAK * 100 .lt. JPI_PGFLQUOTA * (100-percent)
$ then
$ goto skipit
$ elseif
$ goto showit
$ endif
$ endif
$ if check_item .eqs. "PRC"
$ then
$ if ((JPI_JOBPRCCNT * 100) .lt. (JPI_PRCLM * (100-
percent))) .and. -
((JPI_PRCCNT * 100) .lt. (JPI_PRCLM * (100-percent)))
$ then
$ goto skipit
$ elseif
$ goto showit
$ endif
$ endif
$ if JPI_'check_item'CNT*100 .gt. JPI_'check_item'CNT*percent then
goto SKIPIT
$ endif
$!
$ goto showit
$ param_err:
$ say "''Blink' Error! during a context variable scan of process" + -
" ''jpi_prcnam' on node ''jpi_nodename' ''Norm'"
$ on error then goto abortit
$!
$ showit:
$ linecount = linecount + symbolcnt + 1
$ PSCOUNT = PSCOUNT + 1
$!
$! check whether the bottom of screen has been reached
$ if ((LINECOUNT + HEADER + FOOTER) .gt. current_term_height) .or. -
page_display
$ then
$ TOP = NEXTLINE
$ if continuous_display .and. (current_term_height .ge.
max_linecount) -
then page_display = TRUE
$ endif
$!
$ if ((LINECOUNT + HEADER + FOOTER) .ge. current_term_height)
$ then
$ if continuous_display
$ then
$ if page_display
$ then
$ READ /TIME_OUT=3/ERROR=askend sys$command askanswer /PROMPT=
-
"''ESline'''CURSOROFF'''INVERSE'Pausing
00:00:03.00''INVERSEOFF'''ONEUP'"
$ READ sys$command askanswer /PROMPT= -
"''NEXTLINE'''ESline'''INVERSE'Waiting for a
<Return>''INVERSEOFF'''ONEUP'"
$ askend:
$ write sys$output ESline,CURSORON,"Continuing==>"
$ linecount = 0
$ display_head_only = TRUE
$ else
$ if (current_term_height .lt. max_linecount)
$ then
$ current_term_height = LINECOUNT + JUMP
$ if f$mode() .nes. "BATCH" then -
SET TERM /PAGE='current_term_height'
$ endif
$ endif
$ else
$ if page_display
$ then
$ if f$mode() .nes. "BATCH" then read -
/prompt="''BOLD'Press ENTER to continue''NORM'" sys$command
noop
$ display_head_only = TRUE
$ linecount = 0
$ endif
$ endif
$ endif
$!
$! Check if there will be a process context variable dump
$ if display_symbols
$ then
$ if linecount .eq. 0 then display_head_only = TRUE
$ if (.not. continuous_display) then display_head_only = TRUE
$ endif
$!
$! output extra header if requested
$ if display_head_only
$ then
$ gosub displayheader
$ endif
$!
$ if display_symbols
$ then
$ write sys$output ESline, -
"---------------------------------------" + -
"---------------------------------------"
$ linecount = linecount + 1
$ endif
$!
$ !output detail lines
$ if TERM_WIDTH .ge. 132
$ then
$ write sys$output ESline, -
F$FAO("!(#AS) !(#AS) !(#AS) !(#AS)", -
35,node_user_proc,8,jpi_pid, -
8,jpi_jobtype,5,jpi_state), -
F$FAO(" !(#AS) !(#AS) !(#AS) !(#AS) !(#AS)", -
2,jpi_pri,12,jpi_cputim,9,jpi_allio,8,jpi_pageflts,30,jpi_image)
$ else
$ if continuous_display
$ then
$ write sys$output ESline, -
F$FAO("!(#AS) !(#AS) !(#AS)!(#AS)!(#AS)!(#AS)!(#AS)", -
22,node_proc,2,jpi_pri,5,jpi_state, -
12,jpi_cputim,9,jpi_allio,8,jpi_pageflts,20,jpi_image)
$ else
$ write sys$output ESline, -
F$FAO("!(#AS) !(#AS) !(#AS) !(#AS) !(#AS)", -
35,node_user_proc,8,jpi_pid, -
8,jpi_jobtype,5,jpi_state,20,jpi_image)
$ endif
$ endif
$!
$ if P7 .nes. ""
$ then
$ if P7 .eqs. "ALL"
$ then
$ show symbol JPI_*
$ else
$ show symbol JPI_'P7'
$ endif
$ endif
$!
$ if P8 .nes. ""
$ then
$ if P8 .eqs. "ALL"
$ then
$ show symbol JPI_*
$ else
$ show symbol JPI_'P8'
$ endif
$ endif
$!
$ if check_quotas
$ then
$ if check_item .eqs. "PRC"
$ then
$ show symbol JPI_PRCCNT
$ show symbol JPI_JOBPRCCNT
$ show symbol JPI_PRCLM
$ goto ifcheck2
$ endif
$ if check_item .eqs. "PGFLQUOTA"
$ then
$ show symbol JPI_PGFLQUOTA
$ show symbol JPI_VIRTPEAK
$ goto ifcheck2
$ endif
$ show symbol JPI_'check_item'CNT
$ show symbol JPI_'check_item'LM
$ endif
$ ifcheck2:
$!
$ if first_display then goto endit
$!
$ SKIPIT:
$ pid = f$pid(proc_context)
$ if pid .eqs. "" then goto endit
$ goto context_loop
$!
$!
$ ENDIT:
$ if f$type(proc_context) .eqs. "PROCESS_CONTEXT" then -
pid = f$context("process",proc_context,"cancel")
$!
$ proc = f$parse(f$environment("procedure"),,,"name",)
$ if display_symbols
$ then
$ write sys$output ESline, -
"---------------------------------------" + -
"---------------------------------------"
$ linecount = linecount + 1
$ endif
$ if wait_display
$ then
$ write sys$output ESline,CURSOROFF, -
F$FAO("!(#AS)!(#UB) !(#AS)!(#UB) !(#AS) !(#AS) !(#AS)", -
14,"''BOLD'Found:''NORM' ", -
4,PSCOUNT, -
17,"''BOLD'DownCount:''NORM'", -
3,down_count, -
12,"''BOLD'Time:''NORM'", -
8,F$EXTRACT(12,8,F$TIME()), -
33,"''BOLD' WaitDelta:''NORM' ''wait_time'"),EStoEND,ONEUP
$ else
$ if continuous_display
$ then
$ write sys$output ESline,CURSOROFF, -
F$FAO("!(#AS)!(#UB) !(#AS)!(#UB) !(#AS) !(#AS)", -
14,"''BOLD'Found:''NORM' ", -
4,PSCOUNT, -
17,"''BOLD'DownCount:''NORM'", -
3,down_count, -
12,"''BOLD'Time:''NORM'", -
8,F$EXTRACT(12,8,F$TIME())),EStoEND
$ else
$ write sys$output ESline, -
F$FAO("!(#AS)!(#UB) !(#AS) !(#AS)", -
14,"''BOLD'Found:''NORM' ", -
4,PSCOUNT, -
12,"''BOLD'Time:''NORM'", -
8,F$EXTRACT(12,8,F$TIME()))
$ endif
$ endif
$ if (current_term_height - jump .ge. TERM_HEIGHT ) .and. -
(current_term_height - jump_buffer .ge. PSCOUNT) .and. -
continuous_display .and. (.not. display_symbols)
$ then
$ current_term_height = current_term_height - jump
$ if f$mode() .nes. "BATCH" then SET TERM /
PAGE='current_term_height'
$ endif
$ PS_COUNT == PSCOUNT
$ if PS_COUNT .gt. 0
$ then
$ PS_PID == JPI_PID
$ PS_PRCNAM == JPI_PRCNAM
$ PS_USER == JPI_USERNAME
$ PS_NODE == JPI_NODENAME
$ PS_JOB == JPI_JOBTYPE
$ PS_IMAGE == JPI_IMAGNAME
$ if PS_IMAGE .eqs. "" then PS_IMAGE == "IDLE"
$ PS_STATE == JPI_STATE
$ PS_PRI == JPI_PRI
$ PS_CPUTIM == JPI_CPUTIM
$ PS_TIME == JPI_TIME
$ PS_ALLIO == JPI_ALLIO
$ PS_PAGEFLTS == JPI_PAGEFLTS
$ if (check_quotas .OR. display_symbols)
$ then
$ PS_PGFLQUOTA == JPI_PGFLQUOTA
$ PS_VIRTPEAK == JPI_VIRTPEAK
$ endif
$ endif
$!
$ if (.NOT. reloop_OK) then goto abortit
$ if (first_display) .AND. (PSCOUNT .GE. 1) then goto abortit
$ PSCOUNT = 0
$ LINECOUNT = 0
$ if wait_display then wait 'wait_time'
$ if continuous_display .AND. (.NOT. first_display) then goto startit
$!
$ if display_symbols .and. page_display
$ then
$ read/prompt="''BOLD'Press ENTER to continue:''NORM'" sys$command
noop
$ write sys$output ESline,"[procedure ''proc' completed]"
$ endif
$ if f$mode() .nes. "BATCH" then SET TERM/PAGE='TERM_HEIGHT'
$ TEMP = F$VERIFY(PROC_VER, IMAGE_VER)
$ if quiet_display .eq. 1 then ASSIGN/SUPERVISOR_MODE TT: SYS$OUTPUT
$ exit
$!
$!
======================================================================
$!
$ NOTFOUND:
$ PS_COUNT == PSCOUNT
$ if f$type(proc_context) .eqs. "PROCESS_CONTEXT" then -
pid = f$context("process",proc_context,"cancel")
$!
$ proc = f$parse(f$environment("procedure"),,,"name",)
$ gosub displayheader
$ write sys$output ESline, -
"Could not find a process matching your specification!"
$ SAY EStoEND,ONEUP
$ if wait_display
$ then
$ write sys$output ESline, -
F$FAO("!(#AS)!(#UB) !(#AS)!(#UB) !(#AS) !(#AS) !(#AS)", -
14,"''BOLD'Found:''NORM' ", -
4,PSCOUNT, -
17,"''BOLD'DownCount:''NORM'", -
3,down_count, -
12,"''BOLD'Time:''NORM'", -
8,F$EXTRACT(12,8,F$TIME()), -
33,"''BOLD' WaitDelta:''NORM' ''wait_time'")
$ wait 'wait_time'
$ else
$ if continuous_display
$ then
$ write sys$output ESline, -
F$FAO("!(#AS)!(#UB) !(#AS)!(#UB) !(#AS) !(#AS)", -
14,"''BOLD'Found:''NORM' ", -
4,PSCOUNT, -
17,"''BOLD'DownCount:''NORM'", -
3,down_count, -
12,"''BOLD'Time:''NORM'", -
8,F$EXTRACT(12,8,F$TIME()))
$ else
$ write sys$output ESline, -
F$FAO("!(#AS)!(#UB) !(#AS) !(#AS)", -
14,"''BOLD'Found:''NORM' ", -
4,PSCOUNT, -
12,"''BOLD'Time:''NORM'", -
8,F$EXTRACT(12,8,F$TIME()))
$ endif
$ endif
$ if (.NOT. reloop_OK) then goto abortit
$ if continuous_display then goto startit
$ TEMP = F$VERIFY(PROC_VER, IMAGE_VER)
$ if quiet_display .eq. 1 then ASSIGN/SUPERVISOR_MODE TT: SYS$OUTPUT
$ exit
$!
$!
=========================================================================
$!
$ PERCENTERR:
$ errmsg = "%PS-E-PRCNT, Error! - Percent value not within 0 to 100
range!"
$ goto abortit
$!
$ ABORT_C:
$ C_ABORT = TRUE
$ ABORTIT:
$ PS_COUNT == 0 - PSCOUNT
$!
$ if f$type(proc_context) .eqs. "PROCESS_CONTEXT" then -
pid = f$context("process",proc_context,"cancel")
$!
$ if continuous_display then SAY EStoEND
$ proc = f$parse(f$environment("procedure"),,,"name",)
$ if quiet_display .eq. 1 then ASSIGN/SUPERVISOR_MODE TT: SYS$OUTPUT
$ if C_ABORT
$ then
$ write sys$output ESline,"Procedure ''proc' Aborted.",CURSORON
$ else
$ write sys$output ESline,"Procedure ''proc' Finished.",CURSORON
$ endif
$ quitit:
$ if f$mode() .nes. "BATCH" then SET TERM/PAGE='TERM_HEIGHT'
$ if errmsg .nes. "" then say errmsg
$ TEMP = F$VERIFY(PROC_VER, IMAGE_VER)
$ exit
$!
$!
==========================================================================
$!
$ PARAMCOUNT:
$ index = 0
$ PARAM = "." + PARAM - "*" - "*"
$ searchloop1:
$ JPIELEMENT = "." + f$element(index,",",JPILIST1)
$ if JPIELEMENT .eqs. ".," then goto endsearch1
$ if f$locate(PARAM,JPIELEMENT) .ne. f$length(JPIELEMENT) then -
symbolcnt = symbolcnt + 1
$ index= index + 1
$ goto searchloop1
$ endsearch1:
$ index = 0
$ searchloop2:
$ JPIELEMENT = "." + f$element(index,",",JPILIST2)
$ if JPIELEMENT .eqs. ".," then goto endsearch2
$ if f$locate(PARAM,JPIELEMENT) .ne. f$length(JPIELEMENT) then -
symbolcnt = symbolcnt + 1
$ index= index + 1
$ goto searchloop2
$ endsearch2:
$ RETURN
$!
$!
==========================================================================
$!
$ DISPLAYHEADER:
$!output header for default display
$ if continuous_display
$ then
$ if TERM_WIDTH .lt. 132
$ then
$ if (.not. display_head_only) then write sys$output
TOP,ESline,CURSORON, -
BOLD,BLINK,"Scanning:",NORM,F$FAO(" !(#AS)",70,LINE_PARAMETERS)
$ write sys$output ESline, -
F$FAO("''BOLD'!(#AS) !(#AS) !(#AS) !(#AS) !(#AS) !(#AS) !
(#AS)''NORM'", -
6,"Node",14,"ProcessName",3,"Pri",5,"State",10,"CPUTime", -
16,"I/O PgFlts ",20,"Image")
$ else
$ if (.not. display_head_only) then write sys$output
TOP,ESline,CURSORON, -
BOLD,BLINK,"Scanning:",NORM,F$FAO(" !(#AS)",122,LINE_PARAMETERS)
$ write sys$output ESline, -
F$FAO("''BOLD'!(#AS) !(#AS) !(#AS) !(#AS) !(#AS) !(#AS)''NORM'", -
6,"Node",12,"Username",15,"ProcessName",8,"Pid",8,"Jobtype",
5,"State"), -
F$FAO("''BOLD' !(#AS) !(#AS) !(#AS) !(#AS)''NORM'", -
3,"Pri",10,"CPUTime",18,"I/O PgFlts ",30,"Image")
$ endif
$! if display_head_only then linecount = linecount + 1
$ else
$ if (.not. display_symbols) .or. (linecount .le. 1)
$ then
$ if TERM_WIDTH .lt. 132
$ then
$ if (.not. display_head_only) then write sys$output TOP,ESline, -
BOLD,INVERSE,"Scan:",NORM,F$FAO(" !(#AS)",70,LINE_PARAMETERS)
$ write sys$output ESline, -
F$FAO("''BOLD'!(#AS) !(#AS) !(#AS) !(#AS) !(#AS) !(#AS) !
(#AS)''NORM'", -
6,"Node",12,"Username",15,"ProcessName",8,"Pid",8,"Jobtype",
5,"State", -
5,"Image")
$ else
$ if (.not. display_head_only) then write sys$output TOP,ESline, -
BOLD,INVERSE,"Scan:",NORM,F$FAO(" !(#AS)",122,LINE_PARAMETERS)
$ write sys$output ESline, -
F$FAO("''BOLD'!(#AS) !(#AS) !(#AS) !(#AS) !(#AS) !(#AS)''NORM'",
-
6,"Node",12,"Username",15,"ProcessName",8,"Pid",8,"Jobtype",
5,"State"), -
F$FAO("''BOLD' !(#AS) !(#AS) !(#AS) !(#AS) ''NORM'", -
3,"Pri",10,"CPUTime",18,"I/O PgFlts ",30,"Image")
$ endif
$! if display_head_only then linecount = linecount + 1
$ endif
$ endif
$ display_head_only = FALSE
$ RETURN
$!
$!
==========================================================================


.



Relevant Pages