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 OPERATIONS

Former Member
0 Likes
549

Hi,

I am having a four char fields of length 20..

char1 = 'hi'

char2 = 'my'

char3 = 'name'

char4 = 'is,

I want to concatenate all the fields in a string field..

but whn i concatenate it is coming continously like

himynameis

but i need a space in b/w all

hi my name is..

Can anyone help me with sample code

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
492

use .. separated by space

concatenate char1 char2 char3 char4 into char5 separated by space.

4 REPLIES 4
Read only

Former Member
0 Likes
493

use .. separated by space

concatenate char1 char2 char3 char4 into char5 separated by space.

Read only

Former Member
0 Likes
492

Hi,

YOu can do like this :

concatenate char1 ' ' char2 ' ' char3 ' ' char4 ' ' into char.

also u can use the following:

CONCATENATE c1 c2 c3 c4 INTO c5 SEPARATED BY sep.

Regards,

Himanshu

Edited by: Himanshu Verma on Feb 27, 2008 4:44 PM

Read only

Former Member
0 Likes
492

Use Cocatenate A B into C separated by space

Read only

Former Member
0 Likes
492

Hi,

CONCATENATE

Concatenates (chains) several strings to a string.

Syntax

CONCATENATE <c1>... <cn> INTO <c> [ SEPARATED BY <s> ]

[IN BYTE MODE|IN CHARACTER MODE].

This statement concatenates the strings <c1> to <cn> and assigns the result to <c>. The addition SEPARATED BY <s> allows you to specify a character field <s> which is placed in its defined length between the individual fields. In Unicode programs, you must specify whether the statement is a character or byte operation, using the IN BYTE MODE or IN CHARACTER MODE (default) additions.

Regards,

Priya.