IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Panel Counter


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bijal_uma99

New User


Joined: 20 Aug 2009
Posts: 4
Location: India

PostPosted: Thu Aug 20, 2009 7:22 pm
Reply with quote

Mainframers,

I have created a REXX program and its corresponding panel. This panel has a counter to display the number of records read. I need this counter to increase automatically every time I read a record. This will help me to guess the number of records read, and also the time it will take to read the remaining records.

Unfortunately this counter increments only after I press the Enter key.

Any idea how this can be achieved, without pressing the 'Enter' key?

Appreciate the help.

Uma
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 20, 2009 7:25 pm
Reply with quote

change your 7th instruction to &&str(substr(8.))
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Aug 20, 2009 7:31 pm
Reply with quote

dbzTHEdinosauer wrote:
change your 7th instruction to &&str(substr(8.))

Dick, that's the CLIST answer, he's using REXX icon_lol.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Thu Aug 20, 2009 7:39 pm
Reply with quote

Translation: show us your code.

See a recent thread about 'loading animation'.
Back to top
View user's profile Send private message
bijal_uma99

New User


Joined: 20 Aug 2009
Posts: 4
Location: India

PostPosted: Fri Aug 21, 2009 8:20 am
Reply with quote

Thanks for the quick reply.

Here is my code

/********** rexx **************/
opt = ' '
mess = ' '
dater = date(e)
qtime = '09:00:00'
address ispexec "display panel(timepanl)"
do forever
if time() >= qtime | wsopt = 'E' then exit
curhh = substr(time(),1,2)
curmm = substr(time(),4,2)
curss = substr(time(),7,2)
address ispexec "vput curhh "
address ispexec "vput curmm "
address ispexec "vput curss "
address ispexec "display panel(timepanl)"
end

and here is the Panel that I have designed...

)ATTR
$ TYPE(INPUT) INTENS(HIGH)
¢ TYPE(TEXT) INTENS(LOW) CAPS(ON) COLOR(BLUE)
¦ TYPE(TEXT) INTENS(HIGH) CAPS(ON) COLOR(YELLOW)
+ TYPE(TEXT) INTENS(LOW) SKIP(ON) COLOR(YELLOW)
% TYPE(TEXT) INTENS(high) CAPS(ON) COLOR(WHITE)
@ TYPE(TEXT) INTENS(LOW) COLOR(RED) HILITE(BLINK)
)BODY
% ******************************
@ TechM Time Utility DATE : _DATER
% ******************************
¢
¢
¢ Quit Time ===> _qtime +
+
¢ Curr Hours ===> _curhh +
+
¢ Curr Minutes ===> _curmm +
+
¢ Curr Seconds ===> _curss +
+
¢ Message : _mess
+
¢ Enter to Continue or 'E' to Exit _wsopt+
+
+
)INIT
.CURSOR = qtime
)PROC
VPUT wsopt SHARED
vget mess shared
VER (&wsopt,LIST,E,' ')
)END
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Aug 21, 2009 11:51 am
Reply with quote

Very good ........................... BUT

The REXX code and panel bear absolutely no relevence to the topic being discussed.
Back to top
View user's profile Send private message
bijal_uma99

New User


Joined: 20 Aug 2009
Posts: 4
Location: India

PostPosted: Fri Aug 21, 2009 12:48 pm
Reply with quote

Sir

I have written this code to display the time on the screen for every passing second.

I need to update the seconds field on the panel without pressing the 'Enter' key.

Based on this logic, I need to develop a field which will show me the number of records read from a file, like that of a counter.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Aug 21, 2009 1:29 pm
Reply with quote

Dare I ask the business requirement for this frivolity ?

So you want to be processing records in the background and updating a screen with every record processed, along with displaying the current time.

Do you realise just how much resource this will use. As Dick Sch sometimes asks, "Does your family have the hardware contract for your site ?"
Back to top
View user's profile Send private message
bijal_uma99

New User


Joined: 20 Aug 2009
Posts: 4
Location: India

PostPosted: Fri Aug 21, 2009 2:40 pm
Reply with quote

Does this mean that one should not attempt it and learn something from this exercise?

This is not for any business requirement rather for customer delight.

Thanks
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Aug 21, 2009 3:19 pm
Reply with quote

No, not at all.

I will usually try and find something that would benefit from automation, but for reasons of resource usage and maintainability will try to keep the code as simple as possible.

I have been in the situation of picking up somebody elses code and taking an age and a half trying to figure out what they were actually doing. In a lot of cases I have reduced the code from many hundreds of lines to about half the original line count and still maintain the same functionality.

I have also learned a lot from reading other peoples code and the different ways of doing things.

Take THIS topic for example, where there are four or five different solutions to the same request. All of them work, all of them are fairly simple to understand. And I learned other ways of doing the same thing in a way that I had not even thought about.

Do not give up trying to learn, but try to be practical about it. Don't add on loads of bells and whistles that are not required and consume resource, and also try to find a real situation for something to use your learning to solve.

It is good that you want to learn and experiment. I only wish that a lot more people were like that, a bit more adventurous and try things for themselves before posting.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Aug 21, 2009 8:24 pm
Reply with quote

Hello,

Things ("requirements") like this are what many have gotten used to on their pc. On the pc it really doesn't matter that extra resources are allocated and used by some process - it is all single-user and the power of most pc's is much greater than will be needed to support the "bells and whistles".

On the mainframe, these can use (waste) a lot of system resources and even if a simple way to implement is found, they may have a negative impact on the performance of the system. . .

fwiw
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Fri Aug 21, 2009 9:15 pm
Reply with quote

It is not clear if you did this: "See a recent thread about 'loading animation'."

See the ISPF Services manual for 'CONTROL DISPLAY' service.

My suggestion is not to display every time in the loop; you will find that it will go by too fast. I think the customer will still be delighted with updates every 2-5 seconds or so. Likewise, if you are reading records, do not try to display a panel for each record read.

Use 'SLEEP' to wait.

Code:
Call syscalls 'ON'   
Address syscall "sleep" 3     
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat Aug 22, 2009 12:00 am
Reply with quote

Pedro,

Wouldn't the sleep just sleep the whole thing rather than the display process, so in effect make it take even longer ?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sat Aug 22, 2009 2:13 am
Reply with quote

Progress bars and counters tend to be very annoying on the mainframe. About 10 or 15 years ago, IBM added some of these in ISPF for things like member copies and they've added more since then in the data set list. They just slow down the whole process (because the display is synchronous with your process as expat pointed out). Yeeccchh.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Tue Aug 25, 2009 5:10 am
Reply with quote

Sorry about the 'sleep' suggestion... my thought was on a different problem.

For long running tasks, lets say, defined as more than 30 seconds**, I think there should be a progress indicator.

If it is not there and all I see is a system busy indicator on the emulator then I think the system is hung up or there is a loop. That is what the Attn key is for.

I would not do it for every record. Depending on what is going on, I think you should indicate the status every so many instances. Test your application yourself and change it so that you only update the screen every 10 seconds or so.

While updating the screen does add some overhead, it can be useful overhead, so not totally wasted.

** actually, for long tasks, you should submit a batch job.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Preserve changes to ISPF Panel Variables TSO/ISPF 5
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Sort counter to show records combination JCL & VSAM 2
Search our Forums:

Back to Top