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 

ILBOWAT0 Replacement

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ApexNC
Beginner


Joined: 08 Jul 2013
Posts: 2
Topics: 1
Location: Raleigh, NC, USA

PostPosted: Fri Dec 05, 2014 12:37 pm    Post subject: ILBOWAT0 Replacement Reply with quote

I read with interest the (somewhat old) threads on calling ILBOWAT0 to make a program wait/sleep for a given number of seconds. One annoying caveat was that the COBOL program needed to be DATA(24) because ILBOWAT0 is AMODE 24 and can't handle a parm passed above the line. One way around that would be to simply relink ILBOWAT0 as AMODE 31/RMODE ANY since there's nothing intrinsically AMODE24 about it. Another way would be to create your own AMODE31/RMODE ANY version of ILBOWAT0. The following code is for the latter approach. This source (ILBOWAT1) does *exactly* what ILBOWAT0 does - just trimmed down a bit by removing the embedded timestamp and non-essential code:

Code:

ILBOWAT1 AMODE 31                                       
ILBOWAT1 RMODE ANY                                       
ILBOWAT1 CSECT                                           
         STM   14,12,96(13) STORE CALLER REGS           
         LR    10,15        R10 -> ILBOWAT1 (BASEREG)   
         USING ILBOWAT1,10                               
         L     2,0(,1)      R2 -> TIME IN SECONDS       
         L     1,0(,2)      R1 = TIME IN SECONDS         
         M     0,F100       R0&R1 = TIME IN MILLISECONDS
         LTR   0,0          MILLISECONDS > X'FFFFFFFF' ?
         BNE   INVALID       YES: WAIT TIME INVALID     
         LTR   1,1          MILLISECONDS > X'7FFFFFFF' ?
         BNP   INVALID       YES: WAIT TIME INVALID     
         ST    1,4(,2)      STORE TIME IN MILLISECONDS   
         LA    1,4(,2)      R1 -> TIME IN MILLISECONDS   
         STIMER WAIT,BINTVL=(1)                         
         B     DONE         DONE, GO                     
INVALID  LA    15,8         SET RC = 8                   
DONE     ST    15,4(,2)     STORE RETURN CODE     
         L     14,96(,13)   R14 = RETURN ADDRESS 
         LM    0,12,104(13) RELOAD CALLER REGS   
         BR    14           RETURN               
F100     DC   F'100'                             
         END


As you can see, it uses the STIMER macro (SVC 47), which is documented here: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2V2C0/1.4.3.48

In a perfect world (mine), ILBOWAT1 would be even smaller by eliminating: (1) storing and reloading of caller regs, (2) setting a base register, (3) conversion of time value to milliseconds, and (4) error checking. The caller would then simply pass an assumed valid 4-byte binary time value expressed in milliseconds rather than seconds.
Here's the code for that version:

Code:

ILBOWAT1 AMODE 31             
ILBOWAT1 RMODE ANY             
ILBOWAT1 CSECT                 
         L     1,0(,1)         
         STIMER WAIT,BINTVL=(1)
         BR    14             
         END                   
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Dec 05, 2014 1:06 pm    Post subject: Reply with quote

ApexNC,

Thanks for the updated code of ILBOWAT0. I would also like to point out that there are 2 new language environment callable services (Supported as z/OS 1.9) for putting the active enclave to sleep for –Seconds (CEE3DLY), Milliseconds (CEEDLYM)

Check these links which explains in detail about CEE3DLY and CEEDLYM

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA31C0/2.2.5.5?

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA31C0/2.2.5.31

ApexNC wrote:
The caller would then simply pass an assumed valid 4-byte binary time value expressed in milliseconds rather than seconds.


Just out of curiosity does your routine support more than 1 hour of sleep? Both LE calls only support a max of 1 hour sleep.

Technically a 4-byte binary field can store 2,147,483,647, so 2,147,483,647 milliseconds would translate to 5.5 hours. So does your exit put the enclave to sleep for full 5.5 hours?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ApexNC
Beginner


Joined: 08 Jul 2013
Posts: 2
Topics: 1
Location: Raleigh, NC, USA

PostPosted: Fri Dec 05, 2014 5:54 pm    Post subject: Reply with quote

As a test I submitted a request for 4200 seconds (1 hour 10 minutes) and got no complaint from the first ILBOWAT1 program above. So indeed it does appear to support requests of more than 1 hour.
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Sat Dec 06, 2014 9:17 am    Post subject: Reply with quote

What possible business justification would require a batch program to tie up an initiator for that long of a time?
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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