× 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: Trapping Hex Hi and Lo values
  • From: bvining@xxxxxxxxxxxx
  • Date: Thu, 3 Sep 98 11:14:08 CDT

RPG provides figurative constants such as *HIVAL and *LOVAL which equate
to literal values of x'FF...' and x'00...' respectively (when working
with character fields).  These constants are specified without a length
as the length is implied by the field associated with the figurative
constant.  So to trap a character field of x'FFFFFF' could be done as:

     C           FIELD     IFEQ *HIVAL
     C           'EQUAL'   DSPLY
     C                     END

You also asked if the representation of NULL is x'000000', and the
answer is 'it all depends'.  Some languages do equate NULL with a value
of x'00', others equate NULL with the absence of a value.  In the
case of DB2/400, NULL represents a condition where no value is associated
with a field (though the storage allocated for the field will most
certainly contain some hex value which may (or may not) be x'00').  In
this situation the developer needs to test for the condition of NULL and
not the value of NULL (though many have difficulty distinguishing between
the two).

Bruce Vining

>
>Hi All,
>
> In one of our database files, we have some fields with Hex values.
>These are Hex Hi and Lo values. They contain the Hi value (FFFFFF) and lo value
>(000000, is it the representation for NULL??) as the data. I am not good at
>cobol. But someone was telling me that it is possible to pass Hi and Lo values
>in cobol to database fields and in such cases we get Hi and Lo values in Hex
>format.
>
>My problem is that I have to trap for these Hi and Lo values which are stored
>in Hex. How do I do this RPG? Thanx in advance for any help or suggestions.
>
>Rgds
>Vg
>

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.