View previous topic :: View next topic |
Author |
Message |
zerostress Beginner
Joined: 07 Mar 2018 Posts: 5 Topics: 1 Location: Italy
|
Posted: Fri Mar 09, 2018 2:26 pm Post subject: Handle Attention key within the loop with the SLEEP function |
|
|
Hello Mainframer, I am new to this community!
I do need your support/help.
I'am facing a problem with SLEEP function that I am not manage to solve it. Let me explain...
I am developing a sort of monitoring online using REXX with ISPF tables that talking with DB2 subsytem and other system components runs a data auto-refresh showing it to console. In order to refresh, I had to use also a SLEEP function setted to xx minutes that scheduls queries to the DB2. At this point the big question is, how can I properly manage the attention key (PA1) when I am into this SLEEP loop before the IRX0920I message comes out or "IRX0248I Execution halted in host command SLEEP or address environment routine for SYSCALL"? If I press PA1 nothing happens, I have to write HE to force exit.
What is the most correct way to pausing a loop and handling also the exit. Think about to AUTO UPDATE on SDSF (&10) when I press PA1 (attention key) the program manages correctly my exit.
I hope I've made my point.
Piece of REXX code
Code: |
sleep_sec = 30
do until "condition"
...
...
Address ISPEXEC "TBTOP temp"
Address ISPEXEC "CONTROL DISPLAY SAVE"
Address ISPEXEC "CONTROL DISPLAY LOCK"
elapsed_seconds = strip(format(time("E"),,2))
mess = 'Auto-refreshed in 'elapsed_seconds' seconds
Address ISPEXEC "TBDISPL temp PANEL(POPENED)"
rc_display = rc
call syscalls('ON')
Address syscall "SLEEP ("sleep_sec")"
call syscalls('OFF')
Address ISPEXEC "CONTROL DISPLAY RESTORE"
|
PA1:
Code: |
IRX0920I ENTER HI TO END, A NULL LINE TO CONTINUE, OR AN IMMEDIATE COMMAND+ -
he
IRX0929I EXEC EXECUTION HALTED BY USER REQUEST....
IRX0245I REXX exec execution halted.
IRX0248I Execution halted in host command SLEEP or address environment routine
for SYSCALL.
Command terminated due to attention.
*** |
|
|
Back to top |
|
 |
zerostress Beginner
Joined: 07 Mar 2018 Posts: 5 Topics: 1 Location: Italy
|
Posted: Fri Mar 09, 2018 4:05 pm Post subject: |
|
|
...I forgot to say that I also try to add SIGAL ON HALT but unsuccessfully!  |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
zerostress Beginner
Joined: 07 Mar 2018 Posts: 5 Topics: 1 Location: Italy
|
Posted: Sat Mar 10, 2018 6:31 am Post subject: |
|
|
Thank you kolusu for your prompt help.
I had already read your post before and tried your suggested code but for me doesn’t work. The behavior it was exactly the same. I don’t know why. Is it should works?
And why you say “I do NOT recommend this approach.“ What is the best correct method to handle this kind of situations? Are there any other methods?
Thank you again and have a nice week end! |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 12, 2018 1:49 pm Post subject: |
|
|
zerostress wrote: | Thank you kolusu for your prompt help.
I had already read your post before and tried your suggested code but for me doesn’t work. The behavior it was exactly the same. I don’t know why. Is it should works? |
zerostress,
If you hit PA1 and enter HI, it should continue to the next instruction something like this
Code: |
HALT:
LOOP_CONTINUE = 'NO'
SAY ' REXX IS CONTINUING AFTER THE PA1'
CALL pull_data_from_db2 routine
RETURN
|
or did you want to handle the PA1 action in the executing REXX itself?
zerostress wrote: |
And why you say “I do NOT recommend this approach.“ What is the best correct method to handle this kind of situations? Are there any other methods? |
I would never recommend wasting resources like putting something to sleep. I would schedule the exec to run every 15 mins or 30 mins and then refresh the screen. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
zerostress Beginner
Joined: 07 Mar 2018 Posts: 5 Topics: 1 Location: Italy
|
Posted: Mon Mar 12, 2018 4:38 pm Post subject: |
|
|
Quote: | or did you want to handle the PA1 action in the executing REXX itself? |
I would simply handle the PA1 key as clean as possibile and exit from the SLEEP and loops without any IRX message from the REXX or something else. I would like to handle it exactly like in SDSF environment when you set auto-update function (&10).
Is this possible for you? Is it so difficult?
Thank you kolusu for your advices... |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Mar 13, 2018 11:34 am Post subject: |
|
|
zerostress wrote: | Quote: | or did you want to handle the PA1 action in the executing REXX itself? |
I would simply handle the PA1 key as clean as possibile and exit from the SLEEP and loops without any IRX message from the REXX or something else. I would like to handle it exactly like in SDSF environment when you set auto-update function (&10).
Is this possible for you? Is it so difficult?
Thank you kolusu for your advices... |
zerostress,
As Far as I know you cannot handle the PA1 in REXX. May be you can code the function in CLIST. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
zerostress Beginner
Joined: 07 Mar 2018 Posts: 5 Topics: 1 Location: Italy
|
|
Back to top |
|
 |
|
|