cancel
Showing results for 
Search instead for 
Did you mean: 

convert date to int

Former Member
0 Kudos

Hello all,

in a routine I wamt to assign a char value to an int:

data l_day type d value '20110101'.

data day type i.

day = l_day.

Now my problem is, that the integer variable day is filled witth a value 734139.

What is the best thing to do to obtain 20110101 for the integer variable l_day?

Thank You!

Goliad001

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

Include one more step, first take the value of date in char and then pass it to integer.

data l_day type d value '20110101'.

data c_day(8) type c.

data day type i.

c_day = l_day.

day = c_day.

day will have the value as 20110101.

regards,

Arvind.

Former Member
0 Kudos

thanks, the conversion to char did it!

Great!!!

Answers (0)