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

Zeroes in a variable

radhushankar
Participant
0 Likes
445

Hi All

I have to update a field with a value of '001',i have assigned it like this.

Data: variabe(3) type c value'001'.

but when i am concatenating this field with another field these zeroe are getting deleted can any tell me how to get the leading zeros??

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
418

if you use type n declaration then leading zeroes will be padded automatically.

Data: variabe(3) type n value'001'.

2 REPLIES 2
Read only

MarcinPciak
Active Contributor
0 Likes
418

Hi,

Use N instead of C.


Data: var1(3) type n value'001',
        var2 type string,
        res_var type string.
concatenate var1 var2 into res_var.

Regards

Marcin

Read only

Former Member
0 Likes
419

if you use type n declaration then leading zeroes will be padded automatically.

Data: variabe(3) type n value'001'.