Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RPG - How can I change a numeric field to a left-justified character fld w/o zeroes?

211 views
Skip to first unread message

Barbara Osuna

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
I'm pretty new at this, so I'm a little lost. I'm trying to get the
following numeric DESTNO field into a right justified character field so
that I can lose the first 2 characters and grab the next three. Since the
original DESTNO field is varying lengths, this is the only way (without a
lot of programming) that makes sense. Is there a way to do this?

DESTNO
115299251762
115299251762
115299251762
1144292672584
8096643540
114427663366
8096643540
114427662723
114940743772
1144554758564

Thanks!

Bos...@resortmanagement.com


Paul Cunnane

unread,
Jul 13, 1999, 3:00:00 AM7/13/99
to
On Tue, 13 Jul 1999 09:20:39 -0700, "Barbara Osuna"
<bos...@resortmanagement.com> wrote:

>I'm pretty new at this, so I'm a little lost. I'm trying to get the
>following numeric DESTNO field into a right justified character field so
>that I can lose the first 2 characters and grab the next three. Since the
>original DESTNO field is varying lengths, this is the only way (without a
>lot of programming) that makes sense. Is there a way to do this?

In ILE RPG, you can

eval leftno = %trim(%editc(destno:'4'))

and, if you want to extract the three characters in the same
operation, you can even

eval threedig = %subst(%trim(%editc(destno:'4')):3:3)

HTH

_ \ | __| paulcunnane at hotmail
__/ _` | | | | ( | | \ \ _` | \ -_)
_| \__,_|\_,_|_| \___|\_,_|_| _|_| _|\__,_|_| _|\___|
(the address in the header is reversed)

...no-one looks at the menu in a greasy spoon life...
- The Beautiful South

0 new messages