Previous Topic: TLMDATE FROM_JFCB Macro—Convert Date to Internal FormatNext Topic: TLMDATE OPEN Macro—Initialize Date Routines


TLMDATE NUM_DAYS Macro—Days Between Dates

Use the NUM_DAYS form of the TLMDATE macro to calculate and store the number of days between two dates. This function subtracts TODATE from FRDATE and places the difference (number of days) into DAYS. The DAYS= result excludes one day from the FRDATE-TODATE range.

This function uses registers 0, 1, 14 and 15. These registers cannot be used to pass information to the macro.

This macro has the following format:

label TLMDATE NUM_DAYS
,FRDATE=internal1
,TODATE=internal2
,DAYS=days
,ANCHOR=anchor
,PARM=plist
[,NORMAL=branch]
[,ERROR=branch]
[,FAIL=branch]
FRDATE=internal1

Specifies the internal low date used in the subtraction.

Type: RX-type label, (Rn), internal packed (4 bytes)

TODATE=internal2

Specifies the internal high date used in the subtraction.

Type: RX-type label, (Rn), internal packed (4 bytes)

DAYS=days

Specifies the field to receive the resulting difference.

Type: RX-type label, (Rn), packed (4 bytes) or a constant (quotes)

ANCHOR=anchor

Points to the label specified by the ANCHOR form of the TLMDATE macro.

Type: RX-type label or (Rn)

PARM=plist

Points to the label specified by the PARM form of the TLMDATE macro.

Type: RX-type label or (Rn)

NORMAL=branch

(Optional). Specifies the instruction to receive control on return from the CTSDATE module when no errors occurred. If not defined, the next instruction after the macro is executed.

Type: RX-type label

ERROR=branch

(Optional) Specifies the instruction to receive control on return from the CTSDATE module when a date or range error occurred. If not defined, the next instruction after the macro is executed.

Type: RX-type label

FAIL=branch

(Optional) Specifies the instruction to receive control on return from the CTSDATE module when a critical error has occurred. If not defined, the next instruction after the macro is executed.

Type: RX-type label

Example: TLMDATE NUM_DAYS Macro

                                                                  Pos. 72
                                                                  |
TLMDATE  NUM_DAYS,FRDATE=XCRTDT,TODATE=XEXPDT,                    X
      DAYS=XDAYS,ANCHOR=XWANCHOR,PARM=XWPARM,                     X
      ERROR=ABEND10,FAIL=ABEND10