|
Below is a sample of the way I do time arithmetic in a C/L program. I hope
it helps.
PGM
/* CALCULATE THE NUMBER OF SECONDS ELAPSED SINCE MIDNIGHT */
DCL VAR(&HOURSTR) TYPE(*CHAR) LEN(2)
DCL VAR(&HOURNUM) TYPE(*DEC) LEN(2 0)
DCL VAR(&MINSTR) TYPE(*CHAR) LEN(2)
DCL VAR(&MINNUM) TYPE(*DEC) LEN(2 0)
DCL VAR(&SECSTR) TYPE(*CHAR) LEN(2)
DCL VAR(&SECNUM) TYPE(*DEC) LEN(2 0)
DCL VAR(&SECONDS) TYPE(*DEC) LEN(5 0)
RTVSYSVAL SYSVAL(QHOUR) RTNVAR(&HOURSTR)
CHGVAR VAR(&HOURNUM) VALUE(&HOURSTR)
RTVSYSVAL SYSVAL(QMINUTE) RTNVAR(&MINSTR)
CHGVAR VAR(&MINNUM) VALUE(&MINSTR)
RTVSYSVAL SYSVAL(QSECOND) RTNVAR(&SECSTR)
CHGVAR VAR(&SECNUM) VALUE(&SECSTR)
CHGVAR VAR(&SECONDS) VALUE((&HOURNUM * 3600) (&MINNUM *
60) + &SECNUM)
> ----------
> From: Robert E. Burger[SMTP:rburger@home.net]
> Sent: Wednesday, December 01, 1999 8:33 PM
> To: MIDRANGE-L@midrange.com
> Subject: Looking for CL Time Arithmetic Code
>
> Does anyone have any CL time arithmetic code they'd be willing to share.
> On they way into applications, I look at a specific data area to see if a
> backup of that application is in progress -- if it is, I display a screen
> telling the user that app is not available. Ideally, I want to be able to
> store the "current" backup start time and the "last" backup duration and
> use time arithmetic to display an estimate of when the "current" backup
> will be complete.
>
> Thanks in advance,
>
> Robert E. Burger
> Information Systems Coordinator
> Tarrant County CSCD
> Fort Worth, Texas, USA
> =============================
> AS/400 9406-620 running OS/400 V4R2
> AS/400 9406-170 running OS/400 V4R4
>
>
+---
| 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.