Previous Topic: TLMDATE SET_KEYWORD Macro—Define Keyword ValueNext Topic: TLMDATE SUB_YEARS Macro—Subtract Years From Date


TLMDATE SUB_DAYS Macro—Subtract Days From Date

Use the SUB_DAYS form of the TLMDATE macro to subtract a number of days from a date. This function subtracts DAYS from FRDATE and places the resulting date into RESULT.

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 SUB_DAYS
,FRDATE=internal1
,DAYS=days
,RESULT=internal2
,ANCHOR=anchor
,PARM=plist
[,NORMAL=branch]
[,ERROR=branch]
[,FAIL=branch]
FRDATE=internal1

Specifies the internal date to be subtracted from.

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

DAYS=days

Specifies the number of days to be subtracted.

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

RESULT=internal2

Specifies the field to contain the resulting internal date.

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

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 SUB_DAYS Macro

                                                                  Pos. 72
                                                                  |
TLMDATE  SUB_DAYS,ANCHOR=ANCHOR,PARM=DATEPARM,                    X
      FRDATE=TODAY,DAYS=FWORD,RESULT=CLNDATE,                     X
      FAIL=ABEND004,ERROR=ABEND004