MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Handle Attention key within the loop with the SLEEP function

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
zerostress
Beginner


Joined: 07 Mar 2018
Posts: 5
Topics: 1
Location: Italy

PostPosted: Fri Mar 09, 2018 2:26 pm    Post subject: Handle Attention key within the loop with the SLEEP function Reply with quote

Hello Mainframer, I am new to this community! Smile
I do need your support/help.

I'am facing a problem with SLEEP function that I am not manage to solve it. Sad 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. Rolling Eyes

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
View user's profile Send private message
zerostress
Beginner


Joined: 07 Mar 2018
Posts: 5
Topics: 1
Location: Italy

PostPosted: Fri Mar 09, 2018 4:05 pm    Post subject: Reply with quote

...I forgot to say that I also try to add SIGAL ON HALT but unsuccessfully! Rolling Eyes
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Mar 09, 2018 7:17 pm    Post subject: Re: Handle Attention key within the loop with the SLEEP func Reply with quote

zerostress wrote:
Hello Mainframer, I am new to this community! Smile
I do need your support/help.


zerostress,

Welcome to the community. Here is a link which would help you

https://www.mvsforums.com/helpboards/viewtopic.php?p=62151#62151
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
zerostress
Beginner


Joined: 07 Mar 2018
Posts: 5
Topics: 1
Location: Italy

PostPosted: Sat Mar 10, 2018 6:31 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Mar 12, 2018 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
zerostress
Beginner


Joined: 07 Mar 2018
Posts: 5
Topics: 1
Location: Italy

PostPosted: Mon Mar 12, 2018 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Mar 13, 2018 11:34 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
zerostress
Beginner


Joined: 07 Mar 2018
Posts: 5
Topics: 1
Location: Italy

PostPosted: Wed Mar 14, 2018 5:15 am    Post subject: Reply with quote

To solve my problems, I should probably implement these exits or I should do understand better how it works.
Anybody who can help me? Is there someone that already developed it in this big community?

https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.ikja300/ikja300166.htm
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group