View previous topic :: :: View next topic
|
Author |
Message |
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hi Guys,
My requirment is
Address Line1: 'AAAAAAA______________40'
Address Line2: 'BBBBBBB 60'
Where '_' - Spaces
I want to concatenate the Address line 1 & Address line 2 and the desired output should be
Output Concatenated
'AAAAAAA 40 BBBBBBB 60'
Note:- One space should be inserted in between the words in the resultant of concatenated line.
I have referred prior topics, but i couldnt solve my problem, thats why im posting it again.....
Tip me if you have any idea regarding this.
Thanks,
xavier |
|
Back to top |
|
 |
|
|
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Possible scenarios
Code: |
Address Line1
AAAAAAA AAA AAAA 40
AAAAAAA 40 |
|
|
Back to top |
|
 |
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You need small logic and piece of code for it.
But what have you tried till now? where are you stuck? |
|
Back to top |
|
 |
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Hello sambhaji,
I have tried this string statement,
Code: |
STRING WS-ADDR-LINE1 DELIMITED BY SIZE
X'404040' DELIMITED BY ' '
X'4040' DELIMITED BY ' '
' ' WS-ADDR-LINE2 DELIMITED BY SIZE
INTO WS-ADDR-CONCAT3 |
Output has come like,
Code: |
AAAAAAAAAAA 40 BBBBBBB 60 |
Now i want to remove the in-between spaces and should be look like
Code: |
AAAAAAAAAAA 40 BBBBBBBB 60 |
|
|
Back to top |
|
 |
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 757 Location: Germany
|
|
|
|
@xavierrajnaveen
Morning Sir !
Just think of a useful combination of UNSTRING and STRING command
Read about all parameters of Unstring command.
Btw, where comes this "60" from?
In your scenario above, there are only two "40". |
|
Back to top |
|
 |
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Thanks for your information sire Umeysan!!!!
Well, abt 60....is that matters you deviatiang my question if it is , it is just a mistake thats all.
Never mind that...... |
|
Back to top |
|
 |
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
 |
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Sambhaji,
Thank you very much for your timely help [ ] it has solved my problem, one more favour sambhaji if could pls explain the working logic of pointers which you have given will help me a lot.
Thanks again sambaji for ur kind help.......   |
|
Back to top |
|
 |
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
 |
xknight
Active User
Joined: 22 Jan 2008 Posts: 117 Location: Liberty city
|
|
|
|
Sure man.......
Thanks,
Regards,
Xavier Rodriquez |
|
Back to top |
|
 |
|