HP3000-L Archives

December 1997, Week 2

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:
Andreas Schmidt <[log in to unmask]>
Reply To:
Date:
Mon, 8 Dec 1997 18:00:08 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (526 lines)
Here the source of our localized Discfree program, called df5.

[Warning: it's longish but the source code should be readable by every
eMail system ...]


1. Output

DF5.A.00.02     -- Enhanced DISCFREE 5 for System & User Volumes --
                            MON, DEC  8, 1997,  5:53 PM

All measurements are in sectors.
All percentages are relative to the DEVICE size.

XENBH2     |    Configured     |      In Use       |     Available     |
-----------+-------------------+-------------------+-------------------+
MPEXL_SYSTEM_VOLUME_SET
 Device    |   52941520        |   22310400 ( 42%) |   30631120 ( 57%) |
 Permanent |   44470864 ( 83%) |   16427552 ( 31%) |   27626976 ( 52%) |
 Transient |   44470864 ( 83%) |    5882848 ( 11%) |   30581456 ( 57%) |

UV_SET1
 Device    |   66644224        |   41518240 ( 62%) |   25125984 ( 37%) |
 Permanent |   66644224 (100%) |   41518240 ( 62%) |   25125984 ( 37%) |
 Transient |   66644224 (100%) |          0 (  0%) |   25125984 ( 37%) |

UV_SET2
 Device    |  183271616        |  150958080 ( 82%) |   32313536 ( 17%) |
 Permanent |  183271616 (100%) |  150958080 ( 82%) |   32313536 ( 17%) |
 Transient |  183271616 (100%) |          0 (  0%) |   32313536 ( 17%) |

DISKDUMP_VOLUME_SET
 Device    |   20958272        |   20160288 ( 96%) |     797984 (  3%) |
 Permanent |   20958272 (100%) |   20160288 ( 96%) |     797984 (  3%) |
 Transient |   20958272 (100%) |          0 (  0%) |     797984 (  3%) |

UV_SET3
 Device    |  149949504        |  116525760 ( 77%) |   33423744 ( 22%) |
 Permanent |  149949504 (100%) |  116525760 ( 77%) |   33423744 ( 22%) |
 Transient |  149949504 (100%) |          0 (  0%) |   33423744 ( 22%) |

2. Compile xeq.

continue
purge df5 >$null
cob85xl df5s,,$null
run linkedit.pub;info="link from=$oldpass;to=df5;cap=ia,ba,ph"
echo
echo ** Done **

3. Source

001000$control uslinit
001100*************************************************************
001200*       I d e n t i f i c a t i o n   D i v i s i o n       *
001300*************************************************************
001400 identification division.
001500 program-id. df5.
001600*  Version A.00.02
001700*
001800*  Enhanced    DISCFREE 5
001900*  which takes care of different volume sets (system and user)
002000*
002100*  Program must be linked with PH capability.
002101*
002110*  Program was changed for more than 100 devices on 30OCT96
002120*  by Andreas Schmidt, DuPont - Bad Homburg.
002200
002300 author. Wilhelm Apfel, Du Pont - Neu Isenburg.
002400 date-written. April 1994.
002500 date-compiled.
002600
002700$page " "
002800*************************************************************
002900*          E n v i r o n m e n t   D i v i s i o n          *
003000*************************************************************
003100 environment division.
003200 configuration section.
003300 source-computer. hp-3000.
003400 object-computer. hp-3000.
003500 special-names.
003600
003700     condition-code is cc.
003800
003900 input-output section.
004000 file-control.
004100
004200     select i1-discfree  assign to "DF5XYZ  ".
004300
004400$page " "
004500*************************************************************
004600*               D a t a   D i v i s i o n                   *
004700*************************************************************
004800 data division.
004900 file section.
005000
005100 fd  i1-discfree.
005200 01  i1-rec.
005300     03 i1-id                  pic  x(09).
005400     03 filler                 pic  x(05).
005500     03 i1-conf-sect           pic  x(09).
005600     03 i1-conf-sect-n redefines i1-conf-sect  pic  9(09).
005700     03 filler                 pic  x(02).
005800     03 i1-conf-perc           pic  x(03).
005900     03 i1-conf-perc-n redefines i1-conf-perc  pic  9(03).
006000     03 filler                 pic  x(06).
006100     03 i1-inuse-sect          pic  x(09).
006200     03 i1-inuse-sect-n redefines i1-inuse-sect  pic 9(09).
006300     03 filler                 pic  x(02).
006400     03 i1-inuse-perc          pic  x(03).
006500     03 i1-inuse-perc-n redefines i1-inuse-perc  pic 9(03).
006600     03 filler                 pic  x(06).
006700     03 i1-avail-sect          pic  x(09).
006800     03 i1-avail-sect-n redefines i1-avail-sect  pic 9(09).
006900     03 filler                 pic  x(02).
007000     03 i1-avail-perc          pic  x(03).
007100     03 i1-avail-perc-n redefines i1-avail-perc  pic 9(03).
007200     03 filler                 pic  x(12).
007300
007400*-------------------------------------------------*
007500*  W o r k i n g   S t o r a g e   S e c t i o n  *
007600*-------------------------------------------------*
007700 working-storage section.
007800
007900*  Conditions.
008000 01  c1-eof                    pic  x      value "N".
008100     88 c1-eof-true                        value "Y".
008200     88 c1-eof-false                       value "N".
008300
008400*  Display or Print Lines.
008500 01  d01-line1.
008600     03 filler                 pic  x(14)  value " Device    |  ".
008700     03 d01-configured         pic  zzzzzzzz9.
008800     03 filler                 pic  x(11)  value "        |  ".
008900     03 d01-in-use             pic  zzzzzzzz9.
009000     03 filler                 pic  x(02)  value " (".
009100     03 d01-in-use-percent     pic  zz9.
009200     03 filler                 pic  x(06)  value "%) |  ".
009300     03 d01-available          pic  zzzzzzzz9.
009400     03 filler                 pic  x(02)  value " (".
009500     03 d01-available-percent  pic  zz9.
009600     03 filler                 pic  x(04)  value "%) |".
009700
009800 01  d02-line2.
009900     03 d02-id                 pic  x(10)  value space.
010000     03 filler                 pic  x(04)  value " |  ".
010100     03 d02-configured         pic  zzzzzzzz9.
010200     03 filler                 pic  x(02)  value " (".
010300     03 d02-conf-percent       pic  zz9.
010400     03 filler                 pic  x(06)  value "%) |  ".
010500     03 d02-in-use             pic  zzzzzzzz9.
010600     03 filler                 pic  x(02)  value " (".
010700     03 d02-in-use-percent     pic  zz9.
010800     03 filler                 pic  x(06)  value "%) |  ".
010900     03 d02-available          pic  zzzzzzzz9.
011000     03 filler                 pic  x(02)  value " (".
011100     03 d02-available-percent  pic  zz9.
011200     03 filler                 pic  x(04)  value "%) |".
011300
011400*  Header Lines.
011500 01  h01-header1.
011600     03 h01-hpsysname          pic  x(08)  value space.
011700     03 filler                 pic  x(03)  value space.
011800     03 filler                 pic  x(40)  value
011900        "|    Configured     |      In Use       ".
012000     03 filler                 pic  x(21)  value
012100        "|     Available     |".
012200
012300 01  h02-header2.
012400     03 filler                 pic  x(11)  value
012500        "-----------".
012600     03 filler                 pic  x(40)  value
012700        "+-------------------+-------------------".
012800     03 filler                 pic  x(21)  value
012900        "+-------------------+".
013000
013100*  Working Variables and Constants.
013200 01  w01-program-version.
013300     03 w01-pgm-version.
013400        05 filler              pic  x(16)  value
013500           "DF5.A.00.02     ".
013600        05 w01-pgm-id          pic  x(52)  value
013700           "-- Enhanced DISCFREE 5 for System & User Volumes -- ".
013800
013900 01  w02-cmd-image.
014000     03 w02-cmd-msg            pic  x(77)  value space.
014100     03 filler                 pic  x      value %15.
014200
014300 01  w03-cmd-error             pic s9(04)  comp value zero.
014400 01  w04-cmd-parmnum           pic s9(04)  comp value zero.
014500 01  w05-cmd-msglevel          pic s9(04)  comp value 1.
014600
014700 01  w06-dummy.
014800     03 filler                 pic  x(17).
014900     03 w06-work-vol-name      pic  x(29).
015000
015100 01  w07-vs-name               pic  x(26)  value space.
015200
015300 01  w09-dateline.
015400     03 filler                 pic  x(28)  value space.
015500     03 w09-date-line          pic  x(27).
015600     03 filler                 pic  x(01)  value space.
015700
015800 01  filler.
015900     03 w10-table-idx          pic s9(04)  comp value zero.
016000     03 w10-table-ptr          pic s9(04)  comp value zero.
016100     03 w10-table-hit          pic s9(04)  comp value zero.
016200     03 w10-table-max          pic s9(04)  comp value 10.
016300     03 w10-table              occurs 10.
016400        05 w10-vs-name            pic  x(26).
016500        05 w10-device-configured  pic s9(09)  comp value zero.
016600        05 w10-device-in-use      pic s9(09)  comp value zero.
016700        05 w10-device-available   pic s9(09)  comp value zero.
016800        05 w10-perm-configured    pic s9(09)  comp value zero.
016900        05 w10-perm-in-use        pic s9(09)  comp value zero.
017000        05 w10-perm-available     pic s9(09)  comp value zero.
017100        05 w10-trans-configured   pic s9(09)  comp value zero.
017200        05 w10-trans-in-use       pic s9(09)  comp value zero.
017300        05 w10-trans-available    pic s9(09)  comp value zero.
017400
017500 01  w11-percent               pic s9(09)  comp value zero.
017600
017700*---------------------------------*
017800*  run time parm and info string  *
017900*---------------------------------*
018000 01  w100-getinfo.
018100     03 w100-info-buf          pic  x(255) value space.
018200     03 filler                 pic  x.
018300     03 w100-info-len          pic s9(04)  comp value +255.
018400     03 w100-parm              pic s9(04)  comp value zero.
018500
018600*-----------------------------*
018700*  timer for elapsed and cpu  *
018800*-----------------------------*
018900 01  w101-timer.
019000     03 w101-timer-beg         pic s9(09)  comp value zero.
019100     03 w101-timer-end         pic s9(09)  comp value zero.
019200     03 w101-tot-elapsed       pic zzz9,999.
019300     03 w101-tot-cpu           pic zzz9,999.
019400
019500
019600$page "Procedure Division"
019700*************************************************************
019800*            P r o c e d u r e   D i v i s i o n            *
019900*************************************************************
020000 procedure division.
020100 a0-begin  section.
020200 a0-entry.
020300
020400     perform z1-init thru z1-exit.
020500
020600     perform a1-main  thru a1-exit
020700             until c1-eof-true.
020800
020900     perform z2-final  thru z2-exit.
021000     stop run.
021100
021200 a1-main.
021300     read i1-discfree
021400          at end
021500          move "Y"  to c1-eof
021600          go to a1-exit.
021700
021800     if i1-id = "LDEV :   "
021900        move i1-rec  to w06-dummy
022000        move space   to w07-vs-name
022100        string w06-work-vol-name delimited by ":"
022200               into w07-vs-name
022300
022400        if w10-table-ptr = zero
022500           move 1                 to w10-table-ptr
022600           move w07-vs-name  to w10-vs-name (w10-table-ptr)
022700        end-if
022800
022900        move zero  to w10-table-hit
023000        perform a1-1-check-table thru a1-1-exit
023100                varying w10-table-idx from 1 by 1
023200                until w10-table-idx > w10-table-ptr
023300        if w10-table-hit = zero
023400           add 1                  to w10-table-ptr
023500           move w07-vs-name  to w10-vs-name (w10-table-ptr)
023600           move w10-table-ptr     to w10-table-hit
023700        end-if.
023800
023900     if i1-id = "TOTALS : "
024000        perform a1-2-total  thru a1-2-exit
024100                varying w10-table-idx from 1 by 1
024200                until w10-table-idx > w10-table-ptr
024300        move "Y" to c1-eof
024400        go to a1-exit.
024500
024600     if i1-id = " Device  "
024700        add i1-conf-sect-n
024800            to w10-device-configured (w10-table-hit)
024900        add i1-inuse-sect-n
025000            to w10-device-in-use (w10-table-hit)
025100        add i1-avail-sect-n
025200            to w10-device-available (w10-table-hit).
025300
025400     if i1-id = " Permanen"
025500        add i1-conf-sect-n
025600            to w10-perm-configured (w10-table-hit)
025700        add i1-inuse-sect-n
025800            to w10-perm-in-use (w10-table-hit)
025900        add i1-avail-sect-n
026000            to w10-perm-available (w10-table-hit).
026100
026200     if i1-id = " Transien"
026300        add i1-conf-sect-n
026400            to w10-trans-configured (w10-table-hit)
026500        add i1-inuse-sect-n
026600            to w10-trans-in-use (w10-table-hit)
026700        add i1-avail-sect-n
026800            to w10-trans-available (w10-table-hit).
026900
027000 a1-exit.     exit.
027100
027200 a1-1-check-table.
027300
027400     if w07-vs-name = w10-vs-name (w10-table-idx)
027500        move w10-table-idx  to w10-table-hit
027600        go to a1-1-exit.
027700
027800     if w10-table-idx > w10-table-max
027900        display " "
028000        display "Table overflow. Change w10-table. Recompile."
028100        display " "
028200        call intrinsic "QUIT" using w10-table-idx.
028300
028400 a1-1-exit.     exit.
028500
028600 a1-2-total.
028700     display w10-vs-name (w10-table-idx).
028800     move w10-device-configured (w10-table-idx)
028900          to d01-configured.
029000     move w10-device-in-use (w10-table-idx)
029100          to d01-in-use.
029200     move w10-device-available (w10-table-idx)
029300          to d01-available.
029400     compute w11-percent =
029500             (w10-device-in-use (w10-table-idx) * 100) /
029600              w10-device-configured (w10-table-idx).
029700     move w11-percent  to d01-in-use-percent.
029800     compute w11-percent =
029900             (w10-device-available (w10-table-idx) * 100) /
030000              w10-device-configured (w10-table-idx).
030100     move w11-percent  to d01-available-percent.
030200     display d01-line1.
030300
030400     move " Permanent"         to d02-id.
030500     move w10-perm-configured (w10-table-idx)
030600          to d02-configured.
030700     move w10-perm-in-use (w10-table-idx)
030800          to d02-in-use.
030900     move w10-perm-available (w10-table-idx)
031000          to d02-available.
031100     compute w11-percent =
031200             (w10-perm-configured (w10-table-idx) * 100) /
031300              w10-device-configured (w10-table-idx).
031400     move w11-percent  to d02-conf-percent.
031500     compute w11-percent =
031600             (w10-perm-in-use (w10-table-idx) * 100) /
031700              w10-device-configured (w10-table-idx).
031800     move w11-percent  to d02-in-use-percent.
031900     compute w11-percent =
032000             (w10-perm-available (w10-table-idx) * 100) /
032100              w10-device-configured (w10-table-idx).
032200     move w11-percent  to d02-available-percent.
032300     display d02-line2.
032400
032500     move " Transient"          to d02-id.
032600     move w10-trans-configured (w10-table-idx)
032700          to d02-configured.
032800     move w10-trans-in-use (w10-table-idx)
032900          to d02-in-use.
033000     move w10-trans-available (w10-table-idx)
033100          to d02-available.
033200     compute w11-percent =
033300             (w10-trans-configured (w10-table-idx) * 100) /
033400              w10-device-configured (w10-table-idx).
033500     move w11-percent  to d02-conf-percent.
033600     compute w11-percent =
033700             (w10-trans-in-use (w10-table-idx) * 100) /
033800              w10-device-configured (w10-table-idx).
033900     move w11-percent  to d02-in-use-percent.
034000     compute w11-percent =
034100             (w10-trans-available (w10-table-idx) * 100) /
034200              w10-device-configured (w10-table-idx).
034300     move w11-percent  to d02-available-percent.
034400     display d02-line2.
034500
034600     display " ".
034700
034800 a1-2-exit.     exit.
034900
035000
035100 z1-init.
035200
035300*---------------------------------------------*
035400*  initiate timer and display program banner  *
035500*---------------------------------------------*
035600*    call intrinsic "TIMER"  giving w101-timer-beg.
035700     display space.
035800     display w01-pgm-version.
035900
036000     call intrinsic "DATELINE" using w09-date-line.
036100     display w09-dateline.
036200
036300*  get the run parm and info string.
036400     call intrinsic "GETINFO" using w100-info-buf,
036500                                    w100-info-len,
036600                                    w100-parm.
036700
036800*  if run parm=999 show program version, only.
036900     if w100-parm  =  999
037000        stop run.
037100
037200*  try to purge temp file.
037300     move space  to w02-cmd-msg.
037400     move "purge df5xyz,temp >$null"  to w02-cmd-msg.
037500     call intrinsic "HPCICOMMAND" using w02-cmd-image,
037600                                        w03-cmd-error,
037700                                        w04-cmd-parmnum,
037800                                        w05-cmd-msglevel.
037900
038000
038100*  file-eq for discfree output.
038200     move space  to w02-cmd-msg.
038300     move "file df5xyz;temp;rec=-80,,f,ascii"
038400               to w02-cmd-msg
038500     call intrinsic "HPCICOMMAND" using w02-cmd-image,
038600                                        w03-cmd-error,
038700                                        w04-cmd-parmnum,
038800                                        w05-cmd-msglevel.
038900*  exec discfree 3
039000     move space  to w02-cmd-msg.
039100     move "discfree 3 >*df5xyz"  to w02-cmd-msg.
039200     call intrinsic "HPCICOMMAND" using w02-cmd-image,
039300                                        w03-cmd-error,
039400                                        w04-cmd-parmnum,
039500                                        w05-cmd-msglevel.
039600
039700*  reset file-eq.
039800     move space  to w02-cmd-msg.
039900     move "reset df5xyz"  to w02-cmd-msg.
040000     call intrinsic "HPCICOMMAND" using w02-cmd-image,
040100                                        w03-cmd-error,
040200                                        w04-cmd-parmnum,
040300                                        w05-cmd-msglevel.
040400
040500*  get the system name from the HP* variable pool .....
040600     move space                  to w02-cmd-msg.
040700     move "HPSYSNAME          "  to w02-cmd-msg.
040800     call intrinsic "HPCIGETVAR" using w02-cmd-msg,
040900                                       w03-cmd-error,
041000                                       2,
041100                                       h01-hpsysname.
041200
041300*  ... if not available, move unknown to buffer
041400     if w03-cmd-error <> zero
041500        move "Unknown "  to h01-hpsysname.
041600
041700     open input i1-discfree.
041800
041900     display " ".
042000     display "All measurements are in sectors.".
042100     display "All percentages are relative to the DEVICE size.".
042200     display " ".
042300     display h01-header1.
042400     display h02-header2.
042500
042600     perform z1-1-clear-table thru z1-1-exit
042700             varying w10-table-idx from 1 by 1
042800             until w10-table-idx > w10-table-max.
042900
043000 z1-exit.     exit.
043100
043200 z1-1-clear-table.
043300
043400     move space  to w10-vs-name (w10-table-idx).
043500     move zero   to w10-device-configured (w10-table-idx)
043600                    w10-device-in-use (w10-table-idx)
043700                    w10-device-available (w10-table-idx)
043800                    w10-perm-configured (w10-table-idx)
043900                    w10-perm-in-use (w10-table-idx)
044000                    w10-perm-available (w10-table-idx)
044100                    w10-trans-configured (w10-table-idx)
044200                    w10-trans-in-use (w10-table-idx)
044300                    w10-trans-available (w10-table-idx).
044400
044500 z1-1-exit.     exit.
044600
044700 z2-final.
044800
044900     close i1-discfree.
045000
045100*----------------------------*
045200*  display program duration  *
045300*----------------------------*
045400*  calculate total elapsed seconds.
045500*    call intrinsic "TIMER"   giving w101-timer-end.
045600*    subtract w101-timer-beg  from   w101-timer-end.
045700*    move     w101-timer-end  to     w101-tot-elapsed.
045800
045900*  calculate total cpu seconds.
046000*    call intrinsic "PROCTIME"  giving w101-timer-beg.
046100*    move    w101-timer-beg     to     w101-tot-cpu.
046200
046300*    display space.
046400*    display "Elapsed seconds: ",
046500*            w101-tot-elapsed, " - CPU seconds: ",
046600*            w101-tot-cpu.
046700
046800 z2-exit.     exit.


Best regards, Andreas Schmidt
CSC Chemical, Oil & Gas Group
Computing Technical Services - Europe
61352 Bad Homburg, DuPont-Strasse 1, Room 1-346
Germany
Phone: +49(0) 6172 / 87-2117  Fax -2195   DUCOM x951-2117
eMail: [log in to unmask]
HP3000 Intranet Information at
http://dew2.nib.dupont.com/webdoc/hp3000/view.cgi

ATOM RSS1 RSS2