× 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: testing numeric values
  • From: bmorris@xxxxxxxxxx
  • Date: Tue, 23 Nov 1999 12:30:25 -0500




>jzick@MARYWOOD1.MARYWOOD.EDU
>11/22/99 08:31:39 AM wrote:
>
>Hello!
>Does anyone have any information on how to contact Barabara Morris from
the
>IBM Toronto lab?  I am having trouble with some code that she wrote that
>tests numeric values in packed variables.  The code was published in the
>October 1999 edition of MIDRANGE COMPUTING.
>Thanks!

Here I am!  jzick, what is the trouble you are having?

Here's a link to the code that jzick is talking about, along with the
discussion that prompted me to post the code:
http://207.212.90.55/MCForums.nsf/afc6f463929b6359882567b8001d0b66/4f11070839d19858882567b30052d371?OpenDocument

For those who don't have access to MC's forums, here's the little program:

d valBegin        c                   x'+
d                                     00010203040506070809+
d ... add more lines for 101112 ... 808182 ...
d                                     90919293949596979899'
d valLast         c                   x'+
d                                     0A0B0C0D0E0F+
d ... add more lines for 1A1B1C ... 8A8B8C ...
d                                     9A9B9C9D9E9F'
d lastByte        s              1a
c     *ENTRY        PLIST
c                   PARM                  charView  16
c                   PARM                  len        5 0
c                   PARM                  ok         1
 * Check the last byte for digit (0-9) + sign (A-F)
C     1             SUBST     charView:len  lastByte
c     valBegin      CHECK     lastByte                  11=FD
 * Check the first n-1 bytes for digits (0-9) in both nibbles
c                   EVAL      len = len - 1
c     valLast       CHECKR    charView:len              10=FD
 *
c                   EVAL      ok = NOT (*IN10 OR *IN11)
c                   IF        ok = '0'
c     'invalid'     DSPLY
c                   ELSE
c     'ok'          DSPLY
c                   ENDIF
 *
c                   RETURN

Barbara Morris


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


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.