|
Hans, But if the field was fixed length, and we needed to do a %Len() on it, would first moving it to a VARYING field be any different? Wouldn't we have had to do a %trimR(fixed-field) on it to get it in the varying field in the first place? Also, when will you add the second parameter to %TRIM/R/L that supports a character string value, so we can trim off more than just blanks? One last thing, you recently suggested using CHECKR instead of %TRIMR on a field to find its length. Is %TRIMR slower than CHECKR in this situation? If so, why? Bob > -----Original Message----- > From: rpg400-l-admin@midrange.com > [mailto:rpg400-l-admin@midrange.com] On Behalf Of Hans Boldt > Sent: Wednesday, July 17, 2002 2:27 PM > To: rpg400-l@midrange.com > Subject: Re: %trim > > > JJW wrote: > > We recently had IBM do an analysis of some of our most > > used programs in terms of CPU usage. One of the things > > they mentioned was that %trim was a big user of CPU. Has > anyone heard > > this about %trim before? > > %TRIM() works by looping through the character value looking > for the first and last non-blank characters in the string. > If your program makes heavy use of %TRIM() and long fixed > length character strings, it is certainly likely that a lot > of CPU time will be spent there. Whether or not that is > significant depends on other things happening in the program. > > Generally, whenever a program makes heavy use of %TRIM(), you > probably should be using varying length character variables instead. > %TRIM() is often used just to find the length of significant > strings within fixed length character variables. For varying > length variables, the length is maintained as part of the > value, and so the length does not have to be continually re-computed. > > Hans > > > > _______________________________________________ > 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.