|
You should ALWAYS code an edit code of 'X' for any numeric field with a length greater than three for which you do NOT want Query to use an edit code. E.g., if you create a 4 digit year in DDS without an edit code, QUERY will automatically use an edit code which inserts commas. If you want the year to print without commas, just code an edit code of 'X' in your field reference file and reference that field from your physical file. Charles L.Massoglia, President Massoglia Technical Consulting, Inc. cmassoglia@voyager.net In MI 517-676-9700 or in NC 919-363-9395 ----- Original Message ----- From: <rob@dekko.com> To: <rpg400-l@midrange.com> Sent: Thursday, 21 February, 2002 15:55 Subject: Re: %CHAR > > By gum, that works quite nicely. And that 'X' is even on an old O spec > sheet. Of which a chunk is taped to my wall to help me remember these. > > Can this be added as an example in the FAQ? Actually, this is the first > time I've ever used the 'X' format. > > Rob Berendt > -- > "They that can give up essential liberty to obtain a little temporary > safety deserve neither liberty nor safety." > Benjamin Franklin > > > > "Peter Dow" > <pcdow@yahoo.com> To: <rpg400-l@midrange.com> > Sent by: cc: > rpg400-l-admin@mi Fax to: > drange.com Subject: Re: %CHAR > > > 02/21/2002 01:53 > PM > Please respond to > rpg400-l > > > > > > > Hi Rob, > > Michael Plonka already posted the easier method -- edit code "X": > > c eval alpha = %editc(number: 'X') > > which should work in free format. > > Regards, > Peter Dow > Dow Software Services, Inc. > 909 425-0194 voice > 909 425-0196 fax > > ----- Original Message ----- > From: <rob@dekko.com> > Sent: Thursday, February 21, 2002 10:29 AM > Subject: RE: %CHAR > > > > > > Ok, I got it to work. It just took me awhile to figure out that I needed > > to make the edit work 1 character bigger than the variable. For example: > > > > D Alpha s 5a > > D edtwrd c '0 ' > > D number s 5p 0 > > /free > > number=1; > > alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); > > dsply alpha; // '00001' > > number=12; > > alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); > > dsply alpha; // '00012' > > number=123; > > alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); > > dsply alpha; // '00123' > > number=1234; > > alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); > > dsply alpha; // '01234' > > number=12345; > > alpha=%subst(%editw(number:edtwrd):2:%len(alpha)); > > dsply alpha; // '12345' > > *inlr=*on; > > return; > > /end-free > > > > Rob Berendt > > -- > > "They that can give up essential liberty to obtain a little temporary > > safety deserve neither liberty nor safety." > > Benjamin Franklin > > > > > > > > Scott Klement > > <klemscot@klement To: rpg400-l@midrange.com > > s.com> cc: > > Sent by: Fax to: > > rpg400-l-admin@mi Subject: RE: %CHAR > > drange.com > > > > > > 02/21/2002 11:14 > > AM > > Please respond to > > rpg400-l > > > > > > > > > > > > > > > > I can give you examples of using the C functions to convert numeric to > > character, but I'm not sure they belong in the FAQ. The RPG BIFs aren't > > lacking in this area, so why add the complexity? > > > > Any particular reason you wanted to use the C functions? > > > > On Thu, 21 Feb 2002 rob@dekko.com wrote: > > > > > > Buck, > > > > > > I was hoping to see the C functions to convert the numeric into > > character. > > > Or am I confused and they're just useful for the other way? > > > > > > Rob asked: > > > > > > >Who is going to whip up the FAQ? > > > > > > Done. See http://faq.midrange.com/data/cache/184.html or search (lower > > > left) for 'numeric'. > > > > > > --buck > > > > > > > > > > > > > > > > > > _______________________________________________ > 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 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.