× 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: Re[2]: Converting from packed to character in Query/400
  • From: DAsmussen@xxxxxxx
  • Date: Thu, 21 Aug 1997 23:37:44 -0400 (EDT)

Carol,

In a message dated 97-08-19 14:01:19 EDT, you write:

> >I believe you are mistaken about ILE C handling packed decimal.  You 
>   >can declare (and use) packed decimal variables after including 
>   >decimal.h.  Check out the ILE C/400 Programmer's Reference index >for 
>   the few (very) references to using packed decimals.
>   
>   Thanks, John.  I think I may be confused. I should have used the term 
>   "zoned decimal", rather than "packed decimal", but I'm not sure what the 
>   differences are.  I expect it is how the sign is stored. In the numbers
in 
>   my file, the sign is stored in the low order digit.  When the sign is 
>   negative, the low order digit is stored as, e.g. 'J' instead of '1'. (I 
>   think this was once referred to as "sign overpunch", but let's not get
into 
>   that History thing, again!) 

Oh, now!  "Those that fail to learn history are doomed to repeat it"!  You
are correct in the "overpunch" statement, although I cannot imagine why "C"
doesn't read it correctly.  Zoned data appears in the same format as does
character data, although zoned is RARELY used for fields that contain
negative values.  Zone is more often used for values such as order numbers
and dates, which programmers that couldn't read "packed" data created.  A
primer:

Positive Value 123456
Zoned:  123456
Packed: 0246
             135F  (where "F" is positive)

Negative Value 123456
Zoned:  12345J
Packed:  0246
              135D  (where "D" is negative)

Note that the mainframe has unsigned values that, when read on the AS/400
automatically convert the sign byte -- even if the file isn't open for
UPDATE!

Mainframe Packed: 0246
                             135C
Becomes on /400:   0246
                             135F

HTH,

Dean Asmussen
Enterprise Systems Consulting, Inc.
Fuquay-Varina, NC  USA
E-Mail:  DAsmussen@AOL.COM

"A problem is a chance for you to do your best." -- Anonymous
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| 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.