Posted: Fri Dec 05, 2014 12:37 pm Post subject: ILBOWAT0 Replacement
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
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
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Fri Dec 05, 2014 1:06 pm Post subject:
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
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
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.
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