Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

substring functions.

Former Member
0 Likes
698

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.

5 REPLIES 5
Read only

Former Member
0 Likes
665

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

Read only

Former Member
0 Likes
665

hi

try this function


USS_DATE_DECOMPOSITION

bye

Read only

peter_ruiz2
Active Contributor
0 Likes
665

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)

Read only

Former Member
0 Likes
665

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.

Read only

Former Member
0 Likes
665

Hi,

Use the below function module.

CACS_DATE_GET_YEAR_MONTH