Using ADDDUR (or SUBDUR) to manipulate dates

It is fairly easy in ILE to manipulate dates using ADDDUR and SUBDUR. 

Example: using ADDDUR (add duration) to add 7 days.

  * Add one week to a date:
  *
c                   if        UDT1  <=  @UDAT8
c                   ADDDUR    7:*DAYS             JCWED
c       *ISO        move      JCWED               UDT1
c                   endif

In free format RPG the ADDDUR and SUBDUR opcodes must be replaced with the '+' and '-' operators (built in functions or BIFs).

c/free
  jcwed = jcwed + %days(7)   
 /end-free