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



Barbara,

This is what continues to confuse people in RPG.
Some data types, like "I" are well known datatypes that are referred to
in a specific way. For example an "Int 2" value, or an "Int 4" value.
Also we hear "16-bit integer". We never hear "5-digit integer" when
referring to these values.

This was a problem with B ("binary") fields as well.

To this day, I have to correct code that is 2i0 instead of 5i0. Why?
Because 2i0 is correct in the minds of the programmer. In fact, "2i" is
correct enough, but "2i0" is acceptable, as if 4i0, 8i0, and 1i0. Even
someone who uses these values everyday of his life, I find myself
wishing the way they were entered was "4i0" instead of 10i0.

To solve this, I've created a /COPY that includes all these data type,
and I've named them INT1, INT2, INT4, and INT8. And I've been using
LIKE(INT4) in my code.  (Please tell me the LIKE'd fields are INT4 and
not packed!)

Bob Cozzi
cozzi@rpgiv.com
Visit the new on-line iSeries Forums at: http://www.rpgiv.com/forum

> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On
> Behalf Of bmorris@ca.ibm.com
> Sent: Wednesday, December 12, 2001 10:07 AM
> To: rpg400-l@midrange.com
> Subject: RE: Prototype for a command parameter.
>
>
> >Date: Tue, 11 Dec 2001 23:55:03 -0600 (CST)
> >From: Scott Klement <klemscot@klements.com>
> > ...
> >Oh, yes... I knew they added 8-bit integer fields, but I didn't
realize
> >that they continued to expand the (worthless) "B" data type to 8-bits
as
> >well.
>
> Scott, 2B 0 isn't an 8-bit integer.  It's a 16-bit integer, like it
> always was.  2B 0 isn't an expansion.  It's been there "forever" in
RPG
> and DDS at least, and is only supported in ILE RPG for compatibility
> reasons.  (Even if I-binary had been introduced in V3R1, we'd have had
> to keep B-binary.)
>
> You can actually define B fields with any length from 1 to 9, and
> with decimal positions.  RPG B-binary fields are a decimal type, like
> packed and zoned, not an integer type.  The only "binary" thing about
> them is the way they are stored.
>
> Well, you *can* define them, but you shouldn't, except *possibly* to
> save storage for decimal values.  But you should never never never
> (Scott, you obviously already know this, so this isn't for you), you
> should never never never use them when they "match" system binary
> fields (APIs, commands, INFDS etc).
>
> Barbara Morris
>
> "Please miss, is this going to be on the exam?"
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.




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.