HP3000-L Archives

February 1995, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Guy Smith <[log in to unmask]>
Reply To:
Guy Smith <[log in to unmask]>
Date:
Tue, 7 Feb 1995 13:15:23 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (280 lines)
Purge the compilers! Stop me before I program again!
 
A while back there was some good natured discussion
concerning the SHOWJOB command how nice it would be if you
could sort on some of the common fields like account names
or logon date/time.  My alleged mind toyed with this for a
while and dreamed up some feasible ways to make that happen.
I also ground some gray matter to see if there was a simple
way to dump selected fields about jobs and sessions for
cleaner post processing.
 
The problem was that it all seemed too easy.  So naturally I
had to experiment, then slap some code here, bondo there, a
few incantations . . . well, you get the drift.  I spent way
too much time writing a utility which, by the nature of the
original discussion, you may be interested in.
 
I've uploaded Show Job Extended (sjx) to opus.admin.utc.edu.
There are two files, one in squisher format and one in
wrq/label files in a zip file.  Docs are included.  I've
sent a copt to the CSL as well.
 
SJX mimics SHOWJOB format, and allows the list to be sorted
on one or more of 20 different fields.  The output format
matches SHOWJOB, or alternately sjx can dump columns of
selected fields.  It also allows displaying multiple
selected jobs by job number (#j123+s456+j789).  A future
version will allow this by job name with wild cards
(a@,@.@+@,b###.c???).
 
The rest of this message is the documentation (limited as it
is).  Comments, bugs reports, criticisms and flames are
welcome.
 
 
============================================================
 
PROGRAM:       SJX
VERSION:       1.0
BY:            Guy Smith
LANGUAGE:      C
COPYRIGHT:     Guy Smith
CAPS:          PM (AIFs)
 
DESCRIPTION:   The SHOWJOB command has some basic
               limitations.  It cannot sort the list of
               jobs, cannot display selected fields, cannot
               show multiple selected jobs, etc.
 
               SJX is a *rough* clone of the SHOWJOB
               command.  It does not behave in the same way,
               our produce exactly to same output.  It does
               not attempt to replicate CIERRORs when
               problems are encountered.
 
               However, it does allow the reporting of
               several selected jobs (#s1+j2+s3), allows the
               list to be sorted on one or several fields
               (sort by logon date/time, account, CPU use)
               and can report selected fields.  Each of
               these functions is useful in reducing screen
               clutter and/or providing tabular data for
               other programs.
 
USAGE:              |    SCHED                         |
                    |    EXEC                          |
               SJX  |    STATUS                        |
                    |    #J/Snnn+J/Snnn+J/Snnn . . .   |
 
                    |         @J                       |
                    |    ;JOB=@S                       |
                    |         @
 
                    |    ;INTO                         |
                    |    ;EXEC                         |
                    |    ;SUSP                         |
                    |    ;WAIT                         |
 
                    |    ;SORT=fields                  |
                    |    ;FIELDS=fields                |
 
                    |    ;NOHEAD                       |
                    |    ;NOFOOT                       |
 
 
               All parameters are passed to the program in
               the ;INFO= string.  A command file or UDC
               could be setup to pass the parms to ;INFO=
               transparently.
 
               The SHOWJOB parmaters of SCHED, EXEC, and
               STATUS work as they do in SHOWJOB.
 
               SJX can take a list of specific job/session
               numbers (sorry, negative lists and wild cards
               are not yet supported).
 
               One syntactical difference is that the
               selection of WAITed jobs by the deferment
               status of list devices is not supported.
 
               Also note that as of this version, the syntax
               for selecting jobs via ;JOB= is limited to
               selecting just jobs, just sessions, or all
               jobs and sessions.
 
 
FIELDS:        Most of the reportable fields can also be
               used for sorting and reporting.  When the
               ;FIELD= parameter is used, the default format
               is abandoned, and instead one column per
               field are displayed.  The columns will align
               for tabular parsing, but no attempt is made
               to wrap the fields neatly within a set number
               of columns.  So, if you select a huge number
               of fields, they may wrap oddly on a terminal.
 
               For both ;FIELDS= and ;SORT=, most field
               names can be condensed to three characters.
 
               The fields that can be used for sorting and
               selecting include:
 
               NAME           Session name
               USER           User name
               ACCOUNT        Account name
               GROUP          Current group name
               STATE          Execution state (INTRO, SUSP)
               QUITE          In QUIET mode
               STDLIST        $STDLIST in delete state
               INPRI          Input priority
               OUTPRI         Output priority
               INDEV          Input device
               OUTDEV         Output device/class
               DATE*          Start date
               TIME*          Start time
               PRIORITY       Current execution priority
               RESTART        Job keyed to restart
               NUMBERED       Input job file numbered
               PROGRAMMATIC   Programmatic session
               CPU            CPU time (reported in secs)
               CREATIONS      Cumulative process creations
               JSNUMBER       Job/Session number (#Snnn)
               WAIT           Position in waited job list
 
               * Date and time are used together for
               sorting, and you can only specify DATE.
 
EXAMPLES:      The following are a few examples of how SJX
               can be used.
 
 
: sjx
JOBNUM  STATE IPRI JIN  JLIST    INTRODUCED  JOB NAME
 
#J4    EXEC         89S LP       WED 11:11P  FTPMON,FTP.SYS
#J37   EXEC         89S LP       THU  2:12A
STRMJOB,MGR.SERVICE
#S374  EXEC        425  425      WED 11:16A  MGR.SERVICE
#S376  EXEC        254  254      WED 11:32A  SANDI.SERVICE
#J746  SCHED        89S          THU  1:00A
FTSBKUPJ,MGR.FTSLIB
#J773  SCHED        89S          THU  6:30A
ROBOTJOB,MANAGER.SYS
#J771  SCHED        89S          THU  6:00A
TOUCHREM,MGR.SERVICE
 
JOBFENCE= 0; JLIMIT= 30; SLIMIT= 50
 
:: sjx 'sort=account,user,session;job=@j'
JOBNUM  STATE IPRI JIN  JLIST    INTRODUCED  JOB NAME
 
#J761  EXEC         89S LP       WED  2:22A
STRMJOB,MGR.DPSQA
#J759  EXEC         89S LP       WED  2:22A
STRMJOB,MGR.DPSX4
#J746  SCHED        89S          THU  1:00A
FTSBKUPJ,MGR.FTSLIB
#J743  EXEC         89S LP       WED  1:04A
FTSH1L2,MGR.FTSLIB
#J744  EXEC         89S LP       WED  1:04A
FTSRCVRJ,MGR.FTSLIB
#J654  EXEC         89S LP       TUE  3:50P
JOBLSTN,MGR.MBFOSTER
#J740  EXEC         89S LP       TUE 10:39P  JOBRSQ,MGR.NSD
#J70   EXEC         89S LP       THU 10:49A
NETUNIX,MANAGER.RAC
#J38   EXEC         89S LP       THU  2:12A
BWRTJOB,MGR.SERVICE
#J87   EXEC         89S LP       THU  2:28P
CARPLDJ,MGR.SERVICE
#J873  EXEC         89S LP       WED  4:20P
DALE,MGR.SERVICE
#J680  EXEC         89S LP       TUE  4:11P
QUERYSVR,MGR.SERVICE
#J683  EXEC         89S LP       TUE  4:12P
QUERYSVR,MGR.SERVICE
#J682  EXEC         89S LP       TUE  4:12P
QUERYSVR,MGR.SERVICE
#J678  EXEC         89S LP       TUE  4:11P
QUERYSVR,MGR.SERVICE
#J679  EXEC         89S LP       TUE  4:11P
QUERYSVR,MGR.SERVICE
#J681  EXEC         89S LP       TUE  4:12P
QUERYSVR,MGR.SERVICE
#J37   EXEC         89S LP       THU  2:12A
STRMJOB,MGR.SERVICE
#J771  SCHED        89S          THU  6:00A
TOUCHREM,MGR.SERVICE
#J4    EXEC         89S LP       WED 11:11P  FTPMON,FTP.SYS
#J3    EXEC         89S LP       WED 11:10P
CMSG,MANAGER.SYS
#J773  SCHED        89S          THU  6:30A
ROBOTJOB,MANAGER.SYS
#J741  EXEC         89S LP       TUE 10:39P
SCOPEJOB,MANAGER.SYS
#J301  EXEC         89S LP       MON  6:03A
CSISHB,MANAGER.SYSTEM
#J772  EXEC         89S LP       WED  6:06A
USPOOL,MANAGER.SYSTEM
#J742  EXEC         89S LP       TUE 10:39P
BACKG,MANAGER.VESOFT
#J102  EXEC         89S LP       THU  3:45P
BWRTJOB,MGR.WARDS
#J671  EXEC         89S LP       TUE  4:08P
STRMJOB,MGR.WARDS
 
JOBFENCE= 0; JLIMIT= 30; SLIMIT= 50
: :
sjx 'fields=user,account,cpu;sort=cpu'
USER     ACCOUNT  CPU_SECS
MGR      FTSLIB   0
MANAGER  SYSTEM   0
MANAGER  SYSTEM   0
MANAGER  SYSTEM   0
MANAGER  SYS      0
MGR      SERVICE  0
MANAGER  SYSTEM   0
MANAGER  RAC      0
MGR      SERVICE  0
MGR      FTSLIB   0
BOB      SERVICE  5
FTP      SYS      5
JON      SERVICE  7
MGR      WARDS    9
MGR      NSD      9
MGR      SERVICE  10
JAY      SERVICE  10
MGR      SERVICE  12
MGR      DPSX4    12
KRISTIN  SERVICE  97
SHILIN   SERVICE  114
RICH     SERVICE  115
MGR      SERVICE  135
MARY     SERVICE  156
MANAGER  SYSTEM   257
 
JOBFENCE= 0; JLIMIT= 30; SLIMIT= 50
: sjx '#j3+j4+s343+s345'
JOBNUM  STATE IPRI JIN  JLIST    INTRODUCED  JOB NAME
 
#J4    EXEC         89S LP       WED 11:11P  FTPMON,FTP.SYS
#J3    EXEC         89S LP       WED 11:10P
CMSG,MANAGER.SYS
#S343  EXEC        256  256      WED  8:08A  RANDY.NETD
#S345  EXEC        443  443      WED  8:22A  RICH.SERVICE
 
JOBFENCE= 0; JLIMIT= 30; SLIMIT= 50
:
 
 
 =======================================================================
Guy Smith                               Voice:   804-527-4000 ext 6664
Circuit City Stores, Inc.               FAX:     804-527-4116
9950 Mayland Drive                      E-Mail:  attmail.com!bronco!guys
Richmond, VA 23233-1464         Private E-Mail:  [log in to unmask]
 
The thoughts expressed herein are mine and do not reflect those of my
employer, or anyone with common sense.

ATOM RSS1 RSS2