From an article I no longer remember the source of - the first Cl
calls the second one repeatedly and shows a progress bar on your
screen.
Source for TestBarCL:
DCL VAR(&COUNT) TYPE(*DEC) LEN(3 0)
DCL VAR(&COUNTA) TYPE(*CHAR) LEN(3)
TOP: CHGVAR VAR(&COUNT) VALUE(&COUNT + 5)
IF COND(&COUNT > 100) THEN(GOTO CMDLBL(QUIT))
CHGVAR VAR(&COUNTA) VALUE(&COUNT)
CALL PGM(STSBARCL) PARM(&COUNTA)
DLYJOB DLY(1)
GOTO CMDLBL(TOP)
QUIT: RETURN
Source for StsBarCL:
PGM PARM(&PCA)
DCL VAR(&PC) TYPE(*DEC) LEN(3 0)
DCL VAR(&PCA) TYPE(*CHAR) LEN(3)
DCL VAR(&PC@) TYPE(*CHAR) LEN(3)
DCL VAR(&NI) TYPE(*CHAR) LEN(1) VALUE(X'20')
DCL VAR(&RI) TYPE(*CHAR) LEN(1) VALUE(X'33')
DCL VAR(&RI2) TYPE(*CHAR) LEN(1) VALUE(X'23')
DCL VAR(&BAR) TYPE(*CHAR) LEN(40)
DCL VAR(&X) TYPE(*DEC) LEN(3 0)
DCL VAR(&Y) TYPE(*DEC) LEN(2 0)
DCL VAR(&WK20) TYPE(*CHAR) LEN(17)
CHGVAR VAR(&PC) VALUE(&PCA)
CHGVAR VAR(&X) VALUE((&PC / 100) * 40)
CHGVAR VAR(&Y) VALUE((&X / 2) - 2)
IF COND(&X *LE 0) THEN(RETURN)
CHGVAR VAR(&BAR) VALUE(' ')
CHGVAR VAR(&PC@) VALUE(&PC)
IF COND(%SST(&PC@ 1 1) = '0') THEN(CHGVAR +
VAR(%SST(&PC@ 1 1)) VALUE(' '))
IF COND(&Y *GT 0) THEN(do)
CHGVAR VAR(%SST(&BAR &Y 3)) VALUE(&PC@)
CHGVAR VAR(&Y) VALUE(&Y +3)
CHGVAR VAR(%SST(&BAR &Y 1)) VALUE('%')
enddo
CHGVAR VAR(%SST(&BAR &X 1)) VALUE(&RI2)
CHGVAR VAR(%SST(&BAR 40 1)) VALUE(&NI)
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&WK20 || +
&RI || &BAR) TOPGMQ(*EXT) MSGTYPE(*STATUS)
RETURN
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Timothy Adair
Sent: Monday, August 29, 2011 2:05 PM
To: midrange-l@xxxxxxxxxxxx
Subject: CL progress bar
Has anyone found a way to do a simple progress bar in CL? I have a
long-running interactive CL (please don't ask why) and I want to keep
the user informed of the progress. It could be a bar, or just a simple
percent count-up. I've searched the archives and the only thing I found
was Booth Martin's RPG progress bar. A neat piece of work but it
doesn't fit my needs. I'm currently using ten SNDPGMMSG commands (10%,
20%, etc.) sprinkled throughout the code. Clunky, but somewhat
functional.
Maybe I'm dreaming but...
If CL issues (or receives) a return code for every command executed, is
there a way to trigger something after each command, regardless of the
return code? Pretty vague, I know. Sorry about that.
As always, any and all responses are appreciated.
~TA~
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.