Previous Topic: Coding the TLMDATE MacrosNext Topic: TLMDATE ADD_WORK Macro—Add Work Days to a Date


TLMDATE ADD_DAYS Macro—Add Days to a Date

Use the ADD_DAYS form of the TLMDATE macro to add a number of days to a date. This function adds DAYS to TODATE 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 ADD_DAYS
,TODATE=internal1
,DAYS=days
,RESULT=internal2 
,ANCHOR=anchor
,PARM=plist
[,NORMAL=branch]
[,ERROR=branch]
[,FAIL=branch]
TODATE

Specifies the CA TLMS internal date to be added to. This field cannot contain a CA TLMS keyword.

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

DAYS

Specifies the number of days to be added to TODATE.

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

RESULT

Specifies the field to receive the resulting CA TLMS internal date.

Type: RX-type label, 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 ADD_DAYS Macro

                                                                  Pos. 72
                                                                  |
TLMDATE  ADD_DAYS,TODATE=DATE1,RESULT=DATE3,DAYS=PACK1,           X
      ANCHOR=ANCHOR,PARM=DATEPARM