× 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

As the field is numeric it can only contain numeric dat.  To show blanks on the 
display you would need to add the keyword EDTCDE(Z) to the field in your 
display file, however as the Data Type/Keyboard Shift is set then you cannot 
use the keyword.

Instead I would remove the "N" from the Data Type/Keyboard Shift column, change 
the field name on the display and use Eval's within the program to move the 
value back and forth.  That way the EDTCDE keyword could be used.  For example:

Display File: TST001FM
==============
     A                                      CA03(03 'Exit')
     A          R SCREEN1                                  
     A*                                                    
     A            DSPCODE        5  0B  5 18DSPATR(PC)     
     A  01                                  DSPATR(PR)     
     A                                      EDTCDE(Z)      


RPG ILE Source: TST001
===============
     FTST001FM  CF   E             WORKSTN          
                                                    
     D                 Ds                           
     D MsCode                         5i 0 Inz      
                                                    
     C                   DoU       *In03 = *On      
     C                   Eval      DspCode = MsCode 
     C                   Exfmt     Screen1          
     C                   Eval      MsCode = DspCode 
     C                   EndDo                      
                                                    
     C                   Eval      *InLR = *On      
     C                   Return                     

Hope it helps

All the best

Jonathan

-----Original message-----
From: "Luqman" pearlsoft@xxxxxxxxxxxx
Date: Thu, 27 Jan 2005 11:14:52 +0000
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Blank Integer Variable showing as 16448

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


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.