× 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.


  • Subject: Re: convert packed to alpha
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Mon, 09 Jul 2001 10:43:54 -0700
  • Organization: Pacer International

Okay,

Can you please repost the code sample replacing the variable
'l' (lowercase L) with some other variable name?  With the
font I am using in Netscape I can't tell the L's from the one's
so makes it hard to debug.

Which of these is an L and which is a one? l1  8-)

Thanks.

Regards,

Jim Langston

Me transmitte sursum, Caledoni!


> "Simmerlein, Stefan" wrote:
> 
> Hi, i have some problems with this code.
> 
> I've tested it with different numbers, (3617900 for example)
> and it works fine.
> 
> In some cases i've got wrong results.
> For Example:
> hexstring = hex value of 3494402,  5240211
> alphastring = 3494002,  5200211
> 
> Hexstring contains the hex value from a packed field (fieldxyz  9p 0).
> What's wrong ??????????
> 
> The code looks like this
> 
> d universal_ds e ds     extname(filexyz)
>         ......
> d universal         s         500a
>         .....
> d hexstring     s       500a                    (hexstring contains the hex 
>value from a packed number)
> d alphastring   s               500a    inz     (that's the result)
> d l                     s                   3p 0        inz             
>(length oh hexstring)
> 
> d                    ds
> d num                             30p 0
> d char16                         16     overlay(num)
>         .......
> c                   eval      universal = universal_ds
> c                   eval      hexstring = %subst(universal:1:5)         (pos 
>1-5 = packed field 9p 0)
>         .......
> c                   eval      l = %len(hexstring)
> c                   evalr     char16 = %subst(hexstring:1:l)
>         .......
> c     ' ':x'00'     xlate     char16        char16
> c                   eval      alphastring = %char(num)
>         .......

--
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.