× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi

Here is an example of something we are using. It needs some work to
pretty it up, but it should work. The snag is that your OS will have to
be on V5R4 or later.


PGM

/**/

DCL VAR(&STARTVAL) TYPE(*INT) LEN(4) VALUE(0)

DCL VAR(&ENDVAL) TYPE(*INT) LEN(4) VALUE(500000)

DCL VAR(&PROGRESS) TYPE(*DEC) LEN(3 0) /* +

Progress Length */

DCL VAR(&TEMPSTRING) TYPE(*CHAR) LEN(40) +

VALUE('Processing file')

DCL VAR(&MESSAGE) TYPE(*CHAR) LEN(80)

DCL VAR(&TPROGRESS) TYPE(*CHAR) LEN(3)

DCL VAR(&COUNT2) TYPE(*INT) LEN(4)

DCL VAR(&TSTRVAL) TYPE(*CHAR) LEN(10)

DCL VAR(&TENDVAL) TYPE(*CHAR) LEN(10)

/**/

CHGVAR VAR(&TENDVAL) VALUE(&ENDVAL)

/**/

DOFOR VAR(&STARTVAL) FROM(1) TO(&ENDVAL)

CALLSUBR SUBR(SENDMSG)

ENDDO



/**/

SUBR1: SUBR SUBR(SENDMSG)

/* Only Send the message on every 100 iterations */

CHGVAR VAR(&COUNT2) VALUE(&COUNT2 + 1)

IF COND(&COUNT2 >= 100) THEN(DO)

CHGVAR VAR(&TSTRVAL) VALUE(&STARTVAL)

/* Here we determine the progress bar's % val. Check for a zero start
val */
SELECT

WHEN COND((&STARTVAL *LE &ENDVAL) *AND (&STARTVAL +

*NE 0)) THEN(CHGVAR VAR(&PROGRESS) +

VALUE((&STARTVAL / &ENDVAL) * 100))

OTHERWISE CMD(CHGVAR VAR(&PROGRESS) VALUE(100))

ENDSELECT

/**/

CHGVAR VAR(&TPROGRESS) VALUE(&PROGRESS)

CHGVAR VAR(&MESSAGE) VALUE(&TEMPSTRING *BCAT '-' +

*BCAT &TPROGRESS *TCAT '% complete.' +

*BCAT &TSTRVAL *BCAT 'of' *BCAT +

&TENDVAL)

SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +

MSGDTA(&MESSAGE) TOPGMQ(*EXT) +

MSGTYPE(*STATUS)

/* Reset Counter2 back to zero */

CHGVAR VAR(&COUNT2) VALUE(0)

ENDDO

ENDSUBR

/**/

EXIT: ENDPGM



HTH,

Regards,

Pieter Henrico


-----Original Message-----
From: Timothy Adair [mailto:tadair@xxxxxxxxxxxxxxxx]
Sent: Tuesday, August 30, 2011 4:29 PM
To: midrange-l@xxxxxxxxxxxx
Subject: Re: CL progress bar

Not a problem. It's a legitimate question. :-)

The current (old) version is S/36 code - a series of OCL procedures
running a series of RPG II programs and #GSORTs. Our conversion project
is a two-stage process. First we convert it and get it to work (quickly
- deadline). In the second stage of conversion, I can take the time to
change it to batch. It's a hairy little beast (don't get it wet, don't
feed it after midnight, etc.). But for now (and just because I like the
idea) I was looking for a quick, simple status bar that would work
within a rather complex CL.

~TA~



"Mike Cunningham" <mike.cunningham@xxxxxxx> wrote in message
news:mailman.4181.1314706047.2572.midrange-l@xxxxxxxxxxxx...
My apologies. He did. Sorry :(

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Monday, August 29, 2011 11:17 PM
To: Midrange Systems Technical Discussion
Subject: Re: CL progress bar

On Mon, Aug 29, 2011 at 4:34 PM, Timothy Adair
<tadair@xxxxxxxxxxxxxxxx>wrote:

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.

On Mon, Aug 29, 2011 at 9:45 PM, Mike Cunningham
<mike.cunningham@xxxxxxx>
wrote:
Design question. Why are you running this interactive at all?
Why tie up the users terminal for a long running job that can easily
be run in batch and let the user go back to work.

Tim specifically asked us NOT to ask why! :)

John
--
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.


The information contained in this email is confidential and may contain proprietary information. It is meant solely for the intended recipient. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted in reliance on this, is prohibited and may be unlawful. No liability or responsibility is accepted if information or data is, for whatever reason corrupted or does not reach its intended recipient. No warranty is given that this email is free of viruses. The views expressed in this email are, unless otherwise stated, those of the author and not those of HYPHEN Technology (Pty) Ltd or its management. HYPHEN Technology (Pty) Ltd reserves the right to monitor, intercept and block emails addressed to its users or take any other action in accordance with its email use policy.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.