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




On 01/09/2008, at 3:24 AM, Thorbjørn Ravn Andersen wrote:

Really?

Well it is in CCSID 37 which is effectively "standard" EBCDIC.

My colleague said it was a "+" in code page 277 (which is what
we use) but it explains why it croaks.

It is a plus sign in CCSID 277.

Would a "+0001" be a valid
number and ")0001" not so this is a code page problem (in addition to
the prepending sign).

Neither are valid numbers. Zoned decimal is effectively a character representation of a number although it is a numeric field therefore arithmetic calculations are allowed on that field. However, a zoned numeric field has a specific format:

The first (from left) 4 bits of each byte are the zone, the second 4 bits are the digit. These terms hark back to punched cards (zone punch and digit punch). The zone portion of a positive number is always B'1111' or X'F'. The digit portion ranges from B'0000' or X'0' to B'1001' or X'9'. Although EACH zone portion of EACH byte contains X'F' only one of them can really be the sign. The convention is that the right-most zone indicates the sign. X'F' means positive. Negative numbers are represented by X'D' in the zone portion of the right-most byte. EBCDIC operating systems generally tolerate multiple values for positive and negative sign bits but X'F' and X'D' are the preferred values on OS/400. Thus X'F1' is a 1-byte positive 1 and X'D1' is a 1- byte negative one.

Thus you can see that what you are passing in to the COBOL program are not valid numbers.


And by the way - I think that the AS/400 way of sending an inquery
message and me actually being able to get useful info out of the
generated spool is vastly superior to the typical Unix way of
autistically just dumping core :)

Yes, one of the many really nice things about OS/400 and not something that can easily be explained as to how useful it is until experienced.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.