What is the best way to obtain the day, month and year from a date field?

The simplest way to obtain these is via the substring-notation:

Set V[date] "20.02.2003"
Set V[day] "&V[date](1-2)"
Set V[month] "&V[date](4-5)"
Set V[year] "&V[date](7-10)"

In order to make this work for every date representation in SAP, use the following coding:

V[date] is a valid SAP date.

Set V[DateTest] &V[date](5-5)
if V[DateTest=.] or V[DateTest=-] or V[DateTest=/]
Set V[year] &V[date](1-4)
Set V[month] &V[date](6-7)
Set V[day] &V[date](9-10)
else
Set V[year] &V[date](7-10)
Set V[DateTest] &V[date](3-3)
if V[DateTest=.]
Set V[month] &V[date](4-5)
Set V[day] &V[date](1-2)
else
Set V[month] &V[date](1-2)
Set V[day] &V[date](4-5)
endif
endif