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

delete leading zeros

Former Member
0 Likes
2,685

Hi ,

Iam extracting internal order details in a file .Iam getting internal order number leading 6 zeros .I need to delete that 6 zeros .how can i do that one.

thanks,

madhu

Hi ,

Iam extracting internal order details in a file .Iam getting internal order number leading 6 zeros .I need to delete that 6 zeros .how can i do that one.

thanks,

madhu

8 REPLIES 8
Read only

Former Member
0 Likes
1,202

use the FM - conversion_exit_alpha_output

Thanks,

Renjith

Read only

0 Likes
1,202

or you can also use the no-zero opion..

write <fl> to <fld> no-zero.

Regards,

Suresh Datti

Read only

0 Likes
1,202

Simplest option is

MOVE <field-name> left DELETING leading '0'.

If this helps, award points suitably.

Read only

0 Likes
1,202

You can use the function module, or you can use the SHIFT.

Shift the_field left deleting leading '0'.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,202

Hi Priya,

try shift statement to delete leading 0's.

shift field_name left deleting leading '0'.

Cheers,

Vikram

Please reward for helpful replies!!

Read only

aris_hidalgo
Contributor
0 Likes
1,202

Hi, As others said, you could use shift. here is the syntax:

SHIFT c LEFT DELETING LEADING c1.

Also, here are other variants of shift:

1. SHIFT c.

2. SHIFT c BY n PLACES.

3. SHIFT c UP TO c1.

4. SHIFT c RIGHT DELETING TRAILING c1.

Like all string processsing statements, you can only use character-type operands here.

If the type of an operand is not STRING, the operand is treated like a type C field, regardless of its actual type, even though no actual conversion takes place.

Regards!

Read only

Former Member
0 Likes
1,202

HI

GOOD

NO-ZERO Output format: No leading zeros (WRITE)

THANKS

MRUTYUN

Read only

Former Member
0 Likes
1,202

Hi Priya ,

according to your post I assum that allways 6 zeros are leading your datastring...

If it is so you could use:

MOVE data_string+6 to target_string .

The use of:

MOVE .... left DELETING leading '0'

and

Shift the_field left deleting leading '0'

or something else "automatic" may remove a valid ZERO

in position 7 (or more)

(wich is the first position of your data) !

Regards

Rainer

Some points would be nice if that helped a bit.