2009 Jun 17 4:54 PM
Hi Friends,
After CONCATENATE my value is u2018p12345000u2019.
I want to separate last 3 character( 000 ).
Please guide me how to separate last 3 character from the u2018p12345000u2019.
Thanking you friends.
Subash
2009 Jun 18 3:40 AM
Hi Subash,
I feel Simple Shift if very helpful for your case...
Simple you can use the Shift command also,,,,
Example :
SHIFT ALPHA1 BY FIVE PLACES.
SHIFT ALPHA2 RIGHT BY 2 PLACES.
Just use F1 Help for Shift.
Thanks & regards,
Dileep .C
Hi Subash,
I feel Simple Shift if very helpful for your case...
Simple you can use the Shift command also,,,,
Example :
SHIFT ALPHA1 BY FIVE PLACES.
SHIFT ALPHA2 RIGHT BY 2 PLACES.
Just use F1 Help for Shift.
Thanks & regards,
Dileep .C
2009 Jun 17 4:58 PM
Hi,
Incase you know the field length then just use offset.
If you do not know the field length then first determine the field length using STRLEN and the use offset.
for eg.
var1 = p12345000
var2 = var1+5(3).
Regards,
Ankur Parab
2009 Jun 17 5:10 PM
Hi Ankur,
Thanking u .
But that field value is always not constant .
So how to separate always last 3 value only ?
Thanking you friends.
Subash
2009 Jun 17 5:17 PM
Hi,
try this way to separeate the last three values irrespective of lenght..
Data: v1 type string.
Data: vlen type i,
vstart type i.
v1 = u2018p12345000u2019.
vlen = strlen( v1 ).
vstart = vlen - 3.
w_value = v1 + vstart ( 3). "Now the w_Value contains last three values of a string
Regards,
Prabhudas
2009 Jun 17 5:31 PM
Hi,
Try this,
data : a(10) type C,
b(10) type C,
c(20) type C,
d(13) type c.
a = '1234'.
b = '123abc'.
concatenate a b into c.
d = C+7(10).
write d.
it will defintely work for u.
Thanks
2009 Jun 17 5:07 PM
Hi Subash,
You can use the below given logic.
The value can be of any length. The below given code gives you the last 3 characters only:
Data: v1 type string.
Data: vlen type i,
vstart type i.
v1 = u2018p12345000u2019.
vlen = strlen( v1 ).
vstart = vlen - 3.
write: v1+vStart.Rgds,
Ramani N
Edited by: Ramani Nagarajan on Jun 17, 2009 6:12 PM
2009 Jun 18 3:40 AM
Hi Subash,
I feel Simple Shift if very helpful for your case...
Simple you can use the Shift command also,,,,
Example :
SHIFT ALPHA1 BY FIVE PLACES.
SHIFT ALPHA2 RIGHT BY 2 PLACES.
Just use F1 Help for Shift.
Thanks & regards,
Dileep .C
2009 Jun 18 4:33 AM
Hi Dileep Kumar ,
Thank you for your best answer.
Thanking all of U.
Warm regards,
Subash
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |