Application Development 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: 

Delete some of the leading zeros

charla_robertson
Participant
0 Kudos

Hi All,

Just wondering how I can delete some of the leading zeros, but keep two of them.

My field incoming will be '0000000003'. I want to use DELETE LEADING '0', but I want my output to be '003'.

This field incoming can also contain text instead of a number, so I don't want to mess around with field lengths.

Any suggestions?

Thanks

Charla

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Very simple call the conversion exit "conversion_exit_alpha_out"...This will make you output to '3'..Now assign the same to a numerical character

ie Data number(3) type N.

6 REPLIES 6

Former Member
0 Kudos

just move it to another variable of type N size 3.

Arya

JozsefSzikszai
Active Contributor
0 Kudos

hi Charla,

one way:

SHIFT field LEFT DELETING LEADING '0'.

CONCATENATE '00' field INTO field.

this works on any number of leading zeros.

hope this helps

ec

Former Member
0 Kudos

What do you want if the field is '00012'?

What do you want if it's '00a3' or '00a'?

Rob

Message was edited by:

Rob Burbank

Former Member
0 Kudos

Hi Charla,

try to use "Write to".

example:

<b>parameters: num(10) type N.</b>

      • user digit "20"

      • num has the value: "0000000020"

<b>write num+7(3) to num.</b>

      • num has now the value: "020"

<b>write: num.</b>

Regards

Allan Cristian

rodrigo_paisante3
Active Contributor
0 Kudos

Hi, try to use edit mask property, and you can define the format of the strings.

Best Regards,

RP

Former Member
0 Kudos

Very simple call the conversion exit "conversion_exit_alpha_out"...This will make you output to '3'..Now assign the same to a numerical character

ie Data number(3) type N.