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



Hi,

After using INZ, the default value now showing 00000 while I want this to be
blank, because my codes start from 1, so if the user type 1 and press enter,
then it should display as 00001. Any idea please ?

My table field datatype is INTEGER, thats why I used 5I 0, is there any
other way to define Integer variables in RPGILE just to overcome above
problem?

Best Regards,

Luqman





"Jonathan Mason" <masonjo1@xxxxxxxxxxxxxxxx> wrote in
message news:59369d1758f644c4aae43537a08c6c51@xxxxxxxxxxxxxxxxxxx
> Hi Lugman
>
> My understanding is that it's to do with the way in which binary data is
stored and processed within RPG.
>
> As field MSCODE is defined as a 5I data type, it is equivalent to a 2 byte
binary field within RPG and that the initial value for each byte is binary
'01000000' so the whole field becomes binary 0100000001000000 or 16384 + 64
= 16448 which is the value you are getting.
>
> To get round the problem add the "Inz" keyword to the MSCODE definition.
>
>    D MSCODE                         5I 0 Inz
>
> Hopefully somebody can give a more detailed explanation of the binary bit
and correct any errors in my understanding.
>
> All the best
>
> Jonathan
> www.astradyne-uk.com
>
>
> -----Original message-----
> From: "Luqman" pearlsoft@xxxxxxxxxxxx
> Date: Thu, 27 Jan 2005 10:11:01 +0000
> To: rpg400-l@xxxxxxxxxxxx
> Subject: Re: Blank Integer Variable showing as 16448
>
> > I have used an Integer Variable inRPGILE.
> >
> > D MSCODE                         5I 0
> >
> > In DDS, its defined as under:-
> >
> >  A            MSCODE         5N 0B  5 18DSPATR(PC)
> >  A  01                                  DSPATR(PR)
> >
> > The problem is when I run the program, the default value shown in DDS is
:
> > 16448
> >
> > Every field declared as 5I 0 is showing : 16448 as a default value while
> > running the program.
> >
> > I don't know from where this value is coming, any idea please ?
> >
> > Best Regards,
> >
> > Luqman
> >
> >
> >
> >
> >
> > --
> > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> > To post a message email:
RPG400-L@xxxxxxxxxxxx
> > To subscribe, unsubscribe, or change list options,
> > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> > or email: RPG400-L-request@xxxxxxxxxxxx
> > Before posting, please take a moment to review the archives
> > at http://archive.midrange.com/rpg400-l.
> >
>
>
> Jonathan Mason
> www.astradyne-uk.com
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> 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.