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 formatting

Former Member
0 Likes
543

Hello All,

I want to format string and put the data in p1 and p2 string as follows:

Input: xxxxx%7XXXX%7yyyyy

Output: P1 = xxxxx

P2 = yyyyy

Please help.

Regards,

Rajsh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
508

Input: xxxxx%7XXXX%7yyyyy

Output: P1 = xxxxx

P2 = yyyyy

use:

SPLIT input_string AT '%7' INTO p1 p2 p3

use p1 and p3

Deepak

4 REPLIES 4
Read only

Former Member
0 Likes
508

Please search the forum before asking basic questions.

Rob

Read only

Former Member
0 Likes
509

Input: xxxxx%7XXXX%7yyyyy

Output: P1 = xxxxx

P2 = yyyyy

use:

SPLIT input_string AT '%7' INTO p1 p2 p3

use p1 and p3

Deepak

Read only

Former Member
0 Likes
508

Hi,

Use slipt command.

Split string at '%7' into var1 var2 var3.

then the variable will have

var1 = 'xxxx'

var2 = 'XXXX'

var3 = 'yyyy'.

Hope it will help you.

Regards

Manjari.

Read only

Former Member
0 Likes
508

Hi Rajesh,

Check the below code.


DATA : char1 TYPE string VALUE 'xxxxx%7XXXX%7yyyyy',
       p1(5),
       p2(5),
       p3(5).

SPLIT  char1 AT '%7' INTO p1
                          p2
                          p3.