× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Temporary I want to add two leading zeros regardless of number of digits
i want to use it in my RPG program to validiate a data.

Regards,
Srinivas




James Lampert <jamesl@xxxxxxxxxxxxxxxxx> wrote:
Boggula Srinivas wrote:
Hi All,

I have a display field with 8 field numeric length after user enters the data,
i want to prefix two zeros in front of it how will i do it in RPGIV.

If you just want to eliminate zero-blanking, and it's always going to be
non-negative, the easiest way would be to set up a data structure with a
zoned field overlaid on an alphanumeric field of the same length, Z-ADD
your number into the zoned field, then use the alpha field.

Or in a display file, specify the edit code for your field as (if memory
serves correctly) "N".

If, on the other hand, you want to always have exactly two leading
zeroes, regardless of the number of digits that would display with
zero-blanking, it gets more complicated.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.