|
Here is a quickie program I ise to get the percent of disk used:
PGM
DCL VAR(&PCT) TYPE(*CHAR) LEN(7)
DCL VAR(&TOT) TYPE(*CHAR) LEN(7)
DCL VAR(&RCVDTA) TYPE(*CHAR) LEN(067)
DCL VAR(&RCVLEN) TYPE(*CHAR) LEN(4) VALUE(X'00000043')
DCL VAR(&RESETO) TYPE(*CHAR) LEN(10) VALUE('*YES ')
DCL VAR(&FMTNAM) TYPE(*CHAR) LEN(08) VALUE('SSTS0200')
DCL VAR(&ERRSTS) TYPE(*CHAR) LEN(08) VALUE(X'0000000800000000')
DCL VAR(&PCTASP) TYPE(*DEC) LEN(7) VALUE(0)
DCL VAR(&TOTASP) TYPE(*DEC) LEN(7) VALUE(0)
DCL VAR(&PCTX) TYPE(*DEC) LEN(7 4) VALUE(0)
CALL PGM(QWCRSSTS) PARM(&RCVDTA &RCVLEN &FMTNAM &RESETO &ERRSTS)
CHGVAR VAR(&PCTASP) VALUE(%BIN(&RCVDTA 53 4))
CHGVAR VAR(&TOTASP) VALUE(%BIN(&RCVDTA 49 4))
CHGVAR VAR(&PCTX) VALUE(&PCTASP / 10000)
CHGVAR VAR(&PCT) VALUE(&PCTX)
CHGVAR VAR(&TOT) VALUE(&TOTASP)
SNDPGMMSG MSG('The system disk is ' || &PCT *TCAT '% used')
ENDPGM
Bryan Dietz
Dan Rasch <drasch@mail.win.org>
Sent by: owner-midrange-l@midrange.com
05/11/01 04:12 PM
Please respond to MIDRANGE-L
To: MIDRANGE-L@midrange.com
cc:
Subject: Retrieve System Status
I am writing an intelligent reorg program that will sort an outfile
descending by number of deleted records and then reorg files in that
order until a time value is reached. The program is already operational,
but I would like to add a before reorg message of the %ASP used and
an after message, giving the users an idea of how much disk we recovered.
I may even go further to tell them how much storage (instead of a percent)
was regained.
I could do a WRKSTSSTS and parse it, but a retrieve is alot cleaner.
Is there an API or such I could use here?
Thanks,
Dan Rasch - because if the human species concentrated on the really
important things in life, there would be a shortage of fishing poles!
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to
MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.