2007 Aug 23 9:58 AM
data : a(3) type c value '123'.
blank(3) type c ' '.
b (4) type c value '456'.
final type string .
concartenate a blank b into final.
While doing so.....i am expecting FINAL as : 123 456.
123 (3 spaces) 456....but it is not taking 3 blanks between the two variables.
And if i try as......Concatenate a b into final with space
It is showing the result as
123 456.(only one space in between.)....but i want 3 spaces in between.
2007 Aug 23 10:00 AM
hi John,
code like:
CONCATENATE a b INTO final SEPARATED BY ' '.
i. .e. 3 spaces between the ''
data : a(3) type c value '123'.
blank(3) type c ' '.
b (4) type c value '456'.
final type string .
concartenate a blank b into final.
While doing so.....i am expecting FINAL as : 123 456.
123 (3 spaces) 456....but it is not taking 3 blanks between the two variables.
And if i try as......Concatenate a b into final with space
It is showing the result as
123 456.(only one space in between.)....but i want 3 spaces in between.
2007 Aug 23 10:00 AM
hi John,
code like:
CONCATENATE a b INTO final SEPARATED BY ' '.
i. .e. 3 spaces between the ''
2007 Aug 23 10:03 AM
Hi John..
CONCATENATE will remove the Trailing Spaces while concatenating strings.
<b>So Try this.</b>
data : a(3) type c value '123',
blank(3) type C,
b(4) type c value '456',
final type string .
concatenate a blank b into final separated by SPACE.
WRITE: FINAL.
<b>Reward if Helpful</b>
2007 Aug 23 10:06 AM
CONCATENATE will remove the spaces if we use literals that are in single quotes
Single quote - '
Try using back quotes
Back Quote - `
and store 3 spaces in it. This should help, but I am not sure.
2007 Aug 23 10:05 AM
data : a(3) type c value '123'.
blank1(1) type c value '@'.
blank2(1) type c value '@'.
blank3(1) type c value '@'.
b (4) type c value '456'.
final type string
concartenate a blank1 blank2 blank3 b into final.
replace all occurances of '@' with space in final.
reward points to all helpful answers
kiran.M
2007 Aug 23 10:06 AM
Hi use
data : a(3) type c value '123'.
blank(3) type c ' '.
b (4) type c value '456'.
final type string
concatenate a b into final SEPARATED BY blank.
Regards
sandhya
2007 Aug 23 10:11 AM
try this
data : a(3) type c value '123',
blank(3) type c value ' ', " see three spces here
b(4) type c value '456',
final type string .
concatenate a b into final separated by blank.
write : / final.
regards
shiba dutta
2007 Aug 23 10:13 AM
*try this code, it gives three blanks, have checked myself
REPORT ZTRIP_TEST.
data : a(3) type c value '123',
blank(1) type c value ' ',
b(4) type c value '456',
final type string .
concatenate a blank b into final separated by space.
write final.
Reward points if useful, get back in case of query...
Cheers!!!
2007 Aug 23 10:16 AM
data : a(3) type c value '123'.
<b>**blank(3) type c ' '.</b>
b (4) type c value '456'.
final type string .
concartenate a b into final <b>separated by SPACE.</b>
Tihs will sovle your problem... --> gives output as 123 456.
Regards,
SaiRam
2007 Aug 23 10:54 AM
declare blank(3) as follows
data: blank(3) type c value ' '.note: i have not used space but Alt + 0160
to get this character, keep alt pressed, then type 0160 on the numpad, then release the alt
do it thrice for your three space characters
this is the ascii code for space
2007 Aug 23 10:56 AM
so much guys and noone knows the addition of the concatenate statement
you can do following:
concatenate a, '3 blanks here', b into c RESPECTING BLANKS.
Message was edited by:
Florian Kemmer
2007 Aug 23 11:19 AM
Hi florian,
thanx for sharing your knowledge i have written this code in version 4.7
data : a(6) type c value '123',
b(4) type c value '456',
final type string .
concatenate a b into final RESPECTING blankS.
write : / final.
*concatenate a ' ' b into ifinal respecting blanks.
*write : / final.
but it is giving me the error
".", "IN BYTE MODE", "SEPARATED BY ..." or "IN CHARACTER MODE" expected
after "FINAL".
can you tell me what is the reason ?
NB : commented code also i have tried .
regards
shiba dutta
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |