© rubinsoftwarenettetal

The STIMER interface for REXX procedures.

RXSTIMER is an assembler program which is supposed to be used in TSO REXX procedures. REXX does not know any functions to stop a procedure temporarily and equivalent program loops are expensive (CPU consumption).

RXSTIMER can be used to

RXSTIMER is called from the ATTCHPGM LINKPGM environment of MVS, i.e. a Standard S/390 linkage for subprogram calls is used. Thus RXSTIMER can be called e.g. by a Cobol program very easily.

The program RXSTIMER must be available as a load module in the TSO environment either in the Steplib/Linklist/LPA/TSOLIB or ISPLLIB concatenation. Usage within a NetView environment (or any other Automation product) is not recommended because RXSTIMER brings the complete task to a halt.

General Call:

     VAR1 = "mode"
     VAR2 = "time"
     ADDRESS LINKPGM "RXSTIMER VAR1 VAR2"

VAR1, VAR2 - arbitrary variable names

mode - "Mode" to be executed by WAIT. The following is possible:
  • B - waiting period in a (binary) full word in 1/100 seconds
  • D - waiting period in 8 digit format "HHMMSSTH" (character)
  • G - point of time when processing is supposed to be continued (format "HHMMSSTH" Greenwich time)
  • L - point of time when processing is supposed to be continued (format "HHMMSSTH" local time)
time - specifies "how long" (mode B, D) or "till when" (mode G, L) ought to be waited. For mode "B" the required time span is specified in a 4 byte long hex value in 1/100 seconds. For example: for 3 seconds is coded "VAR2 = D2C(300,4)". For all other modes the required time is specified in a string of 8 bytes resembling hour, minute, second, 10th of a second, 100th of a second. For example: 18:37:30 is coded VAR2 = '18373000' .

More Examples:

     /* Wait 5 seconds, mode binary */
     time  = d2c(500,4);mode = "B"
     ADDRESS LINKPGM "RXSTIMER MODE TIME"

     /* Wait 1 hour, 5 minutes 8.50 seconds, Mode Character */
     time  = "01050850";mode = "D"
     ADDRESS LINKPGM "RXSTIMER MODE TIME"

     /* Wait til 16:38:10, local time */
     time   = "16381000";mode = "L"
     ADDRESS LINKPGM "RXSTIMER MODE TIME"

Usage of RXSTIMER
  • RXSTIMER does not verify the input parameters. Wrong Specifications of the waiting period can result in abends or very long waiting periods which may only be stopped by a CANCEL command issued by the TSO user. Please consider the remarks on the STIMER macro in the IBM literature.
  • If the waiting mode is specified wrongly, no wait will be executed. In the source code you will find remarks telling you how to alter RXSTIMER in order to produce an abend instead.
  • RXSTIMER will always produce an RC of zero.
Installation of RXSTIMER
  • RXSTIMER is rolled out in assembler source code.
  • The generated load module must be available in the TSO environment either in the Steplib/Linklist/LPA/TSOLIB or ISPLLIB concatenation.
  • RSTIMER does not require APF authorisation und should run under all MVS and OS/390 releases.
At any time you can download the most current version for free from http://www.rubin-software.de

         TITLE 'RXSTIMER: Simple Interface to STIMER WAIT function'
         PRINT  NOGEN
**********************************************************************
* GDOC:                                                              *
* RXSTIMER: Interface to STIMER WAIT for REXX routines               *
**********************************************************************
* Copyright 1998                                                     *
* rubin Software GmbH                                                *
* An der Kirche 5a                                                   *
* D-41334 Nettetal                                                   *
* Author: Wolfgang Schaefer                                          *
* Web: www.rubin-software.de                                         *
* EMail: support@rubin-software.de                                   *
*                                                                    *
* THIS PROGRAM IS PROVIDED ON AN ASIS BASIS.                         *
* NO EXPRESSED OR IMPLIED WARRANTY IS GIVEN THAT THIS PROGRAM        *
* WILL FUNCTION PROPERLY.                                            *
**********************************************************************
* DESC:                                                              *
* This is a simple assembler subroutine that gives REXX procedures   *
* access to the MVS STIMER WAIT function. This can be used to        *
* realize 'friendly' delays that do not use CPU resources (like      *
* do loops). More documentation can be found in the HTML document    *
* that describes this program ...                                    *
**********************************************************************
* LINKAGE:                                                           *
* This program uses standard S/390 linkage for subprogram. Two       *
* parameters are expected: Mode (see doc or source) and Value (which *
* describes how long we wait)                                        *
* The return will always be zero (if we do not abend ...)            *
* NOTE THAT THE VALUE PARAMETER IS NOT VERIFIED WHICH CAN CAUSE      *
* ABENDS OR VERY, VERY LONG WAITS IF SPECIFIED INCORRECTLY ...       *
* (SEE NOTES FOR STIMER IN THE IBM LITERATURE)                       *
**********************************************************************
* TECHDOC:                                                           *
* Register usage:                                                    *
* R11 - base register work area (re-entrant)                         *
* R12 - base register code                                           *
* R13 - own savearea                                                 *
* REENTRANT, LPA ELIGABLE                                            *
**********************************************************************
RXSTIMER CSECT
RXSTIMER AMODE ANY
RXSTIMER RMODE ANY
         SPACE 3
**********************************************************************
** REGISTER EQUATES                                                 **
**********************************************************************
R0       EQU   0                     DEFINE REGISTER EQUATES
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
R5       EQU   5
R6       EQU   6
R7       EQU   7
R8       EQU   8
R9       EQU   9
R10      EQU   10
R11      EQU   11
R12      EQU   12
R13      EQU   13
R14      EQU   14
R15      EQU   15
         SPACE 3
**********************************************************************
** STARTUP CODE                                                     **
**********************************************************************
         STM   R14,R12,12(R13)         SAVE CALLER'S REGISTERS
         LR    R12,R15                 SET UP PROGRAM BASE REGISTER
         LR    R10,R1                  SAVE PARMLIST ADDRESS (TEMP)
         USING RXSTIMER,R12            ESTABLISH ADDRESSABILITY CODE
         GETMAIN RU,LV=72              OBTAIN SAVEAREA
         ST    R13,4(,R1)              BACKWARD CHAIN
         ST    R1,8(,R13)              FORWARD CHAIN
         LR    R13,R1                  CURRENT SAVEAREA IN R13
         GETMAIN RU,LV=QWORKL          OBTAIN WORKAREA
         LR    R11,R1                  ESTABLISH ADDRESSABILITY
         USING WORK,R11
         ST    R10,PLISTA              STORE PLIST ADDRESS
         B     MAIN000                 BRANCH TO MAINLINE
         SPACE 1
**********************************************************************
** CONSTANTS                                                        **
**********************************************************************
**********************************************************************
** MAINLINE                                                         **
**********************************************************************
MAIN000  DS    0H
         MVC   RETV,=F'0'
         L     R5,PLISTA               ParamList
         L     R6,0(R5)                FIRST PARAM (TYPE OF WAIT)
         L     R7,4(R5)                SECOND PARAM (INTERVAL)
*
         CLI   0(R6),C'B'              BINTVL? (1/100 SEK)
         BNE   MAIN010                 NO
         MVC   P2VAL,0(R7)             YES, MOVE PARM TO DWORD
         STIMER WAIT,BINTVL=P2VAL
         B     MAIN9000                RETURN TO CALLER
*
MAIN010  DS    0H
         CLI   0(R6),C'D'              DINTVL? (HHMMSSTH)
         BNE   MAIN020                 NO
         MVC   P2VAL,0(R7)             YES, MOVE PARM TO DWORD
         STIMER WAIT,DINTVL=P2VAL
         B     MAIN9000                RETURN TO CALLER
*
MAIN020  DS    0H
         CLI   0(R6),C'G'              GMT? (HHMMSSTH)
         BNE   MAIN030                 NO
         MVC   P2VAL,0(R7)             YES, MOVE PARM TO DWORD
         STIMER WAIT,GMT=P2VAL
         B     MAIN9000                RETURN TO CALLER
*
MAIN030  DS    0H
         CLI   0(R6),C'L'              LOCAL TIME? (HHMMSSTH)
         BNE   MAIN040                 NO
         MVC   P2VAL,0(R7)             YES, MOVE PARM TO DWORD
         STIMER WAIT,LT=P2VAL
         B     MAIN9000                RETURN TO CALLER
MAIN040  DS    0H
*
* if you decide to have a dump in case of an unsupported mode value
* uncomment the next line ...
*        DC    H'0'                    GIVES S0C1
* The default implementation will return 12 (instead of 0)
         MVC   RETV,=F'12'
         B     MAIN9000                JUST DON'T WAIT
*
**********************************************************************
** EXIT CODE                                                        **
**********************************************************************
MAIN9000 DS    0H
         L     R5,RETV                 LOAD RETURN CODE
         FREEMAIN RU,A=(R11),LV=QWORKL FREE WORKAREA MEMORY
         LR    R1,R13                  SAVEAREA ADDRESS FOR FREEMAIN
         L     R13,4(,R13)             RESTORE CALLER'S SAVEAREA
         FREEMAIN RU,A=(R1),LV=72      FREE OWN SAVEAREA
         LR    R15,R5                  RETURN CODE TO R15
         L     R14,12(R13)             LOAD RTC ADDRESS
         LM    R0,R12,20(R13)          RELOAD REGISTERS
         BR    R14                     RETURN TO CALLER
         SPACE
         LTORG
         SPACE
**********************************************************************
** Program Workarea                                                 **
**********************************************************************
         SPACE
WORK     DSECT                        WORK AREA
P2VAL    DS    D                      PARAMETER FOR STIME
PLISTA   DS    F                      ADDRESS OF PLIST
RETV     DS    F                      RETURN VALUE
*
QWORKL   EQU   *-WORK                 LENGTH OF WORKAREA LAST ENTRY !
         END
back to Help in Daily Life