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

Character logic?

Former Member
0 Likes
821

Hi,

Data: Char type c value '2008'.

I want to take only 08 from 2008.

Can you please tel me the logic for this result?

thanks

sekhar

1 ACCEPTED SOLUTION
Read only

peter_ruiz2
Active Contributor
0 Likes
797

hi Chendra,

use this code:


Char = Char+2(2).

Hi,

Data: Char type c value '2008'.

I want to take only 08 from 2008.

Can you please tel me the logic for this result?

thanks

sekhar

6 REPLIES 6
Read only

peter_ruiz2
Active Contributor
0 Likes
798

hi Chendra,

use this code:


Char = Char+2(2).

Read only

Former Member
0 Likes
797

Data: Char(4) type c value '2008'.

char+2(2)

award points if this helps you

james lising

Read only

Former Member
0 Likes
797

try this

Data: Char(10) value '2008'.

data : str1(3) ,

str2(4).

SPLIT char at '20' INTO: str1 str2.

write : str1 , str2.

reward if helpful

Read only

Former Member
0 Likes
797

Hello Sekhar-

If the data in result variable is 2008 and your requirement is pull last 2 chars.

data:v_re(2) type C.

v_re = result+2(2).

Cheers,

~Srini...

Read only

Former Member
0 Likes
797

Hi Chandra,

First i want to make clear to you that char contains only 2 instead of 2008. because by default if you declare type c means it contains only one character.

so how can you take out 08 from 2008.

Hope now its clear .

Please Reward.

Amit.

Read only

0 Likes
797

Hi,

You can refer in my first answer about your question.

reward points.

james