04-14-2008 9:31 AM
i have a date variable which has 21.03.2008 ie DD.MM.YYYY format.
i want to extract month and year separately into different variables.
wht is eh function or way to do it.
04-14-2008 9:34 AM
hi,
do this way ..
data : v_date(1) value '21.03.2008',
v_month(2),
v_year(2).
v_month = v_date+3(2).
v_year = v_date+6(4).
Regards,
Santosh
04-14-2008 9:34 AM
04-14-2008 9:35 AM
hi,
if your date is exactly the same with how you write it including the periods.
use this code
month = datum+3(2)
date = datum (2)
04-14-2008 9:46 AM
Hi
Check this simple program
DATA : date type string,
dd type char2,
mon type char2,
year type char4.
date = '21.04.2008'.
SPLIT date at '.' into dd mon year.
WRITE :
dd, mon, year.
HOPE IT HELPS.
04-14-2008 10:03 AM