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

string to int4!!

Former Member
0 Likes
706

Hi,

I need to move a string variable to int4(10) variable , but the moment i try to move , it's throwing the dump saying conversion not allowed...am trying to move 12:00 to int4 field....

whats the way out?

Regards

Gunjan

3 REPLIES 3
Read only

Former Member
0 Likes
638

Hi Gunjan,

U cant move :,space or any other special character into Int type variable so try to move 1200 into int4 type variable.

it will work.

data: a type int4,

ch(10) type c.

ch = '1200'.

a = ch.

it works.

Regards,

Ravi G

Read only

athavanraja
Active Contributor
0 Likes
638

data: abc type string ,

def type int4 .

abc = '12:00' .

shift abc right deleting trailing '0' .

shift abc right deleting trailing ':' .

condense abc no-gaps .

def = abc .

Read only

Former Member
0 Likes
638

HI,

use type N instead of I.

data:char(5) value '12:00',num(5) type n.

num = char.

write:num.

rgds,

bharat.