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


  • Subject: RE: %Trim
  • From: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Thu, 27 Aug 1998 14:12:58 -0400
  • Organization: commsoft

On Thursday, August 27, 1998 10:10 AM, Rob Berendt [SMTP:rob@dekko.com] 
wrote:
> Has anyone noticed how slowwww that %Trim is?   Create an ILE RPG 
program
> with a alpha variable of 32,767 bytes long.  Perform a %Trim operation
> on that field.  Run it in debug.

I did a quickie test of this on my heavily loaded 620.  500 loops of 
%len(%trim(String)).  "String" contains the literal "Short string here". 
 If "String" is declared 20 bytes long, it takes :02.  If "String" is 
delcared 32000 bytes long, it takes 7:54.

> Another thing I've noticed.  There are times when you would think that a
> %Trim should work when you should be using a %TrimR.  For example
> DRecipientDS      DS
> D  RecOffSet              1      4B 0 INZ(0)
> D  AddrLen                5      8B 0 INZ(0)
> D  Format                 9     16    INZ('ADDR0100')
> D  DistrType             17     20B 0 INZ(0)
> D  Reserved              21     24B 0 INZ(0)
> D  Recipient                         Like(RecAddr) INZ('rob@dekko.com')
> C                   Eval      RecOffSet = %Len(%Trim(RecipientDS))
>  * In the above RecOffSet will be equal to 29 because the first two
>  subfields will be dropped.
> * In the following RecOffSet will be equal to 37.
> C                   Eval      RecOffSet = %Len(%TrimR(RecipientDS))

I see 37 in both instances on my V4R2 machine.

Buck Calabro
Commsoft, Albany, NY
mailto:mcalabro@commsoft.net

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.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.