× 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: Eval expression problem
  • From: Scott Mildenberger <Smildenber@xxxxxxxxxxxx>
  • Date: Wed, 28 Jun 2000 13:45:10 -0600

Steve,

How big are the elements in the array 'months', if they are 25 characters or
more then that explains it, the 50 character logtext field would be filled
up with the blanks following the month name.  Try using %trim(Months(Lmm) )
in the first eval and I think it will work ok.  Your second example uses the
%trimr after the month name to remove the trailing blanks.

Scott Mildenberger

> -----Original Message-----
> From: Steve Moland [SMTP:Steve@Accessp.com]
> Sent: Wednesday, June 28, 2000 12:26 PM
> To:   'RPG400-L@midrange.com'
> Subject:      Eval expression problem
> 
> I can't seem to figure out why the first example does not produce 
> the same answer as the second very kludge example. 
> The day and year and time do not make it into the output field in example
> 1. 
> 
> "Months" is an array of month names. 
> RSFLIB is 10 character (so says RPG ) variable length field 
>      in a file created by SQL. It contains "TRRSF999P" 
> Lmm is a 2 byte signed numeric field containing  05 
> Ldd is a 2 byte signed numeric field containing  28 
> Lyyyy is a 4 byte character field containing  2000 
> Lhhmmss is a 6 byte signed numeric field containing  010647 
> #Time is a 8 byte character field 
> LOGTEXT is 50 character field. 
> 
> I                        *VAR A  113  124  RSFLIB  
> 
> Example 1 
> Eval                    logtext = RSFLIB + ' was rebuilt on ' +  
>                         Months(Lmm) + %editw(Ldd : ' 0') +    
>                         ', ' + Lyyyy  +                             
>                         ' at ' + %editw(Lhhmmss : '0 :  :  ')       
> 
> LOGTEXT = 'TRRSF999P was rebuilt on May                      '  
> 
> Example 2 
> Eval                    logtext = RSFLIB + ' was rebuilt on ' +     
>                         Months(Lmm)                                 
> eval                    logtext = %trimr(logtext) + ' ' +           
>                         %editw(Ldd : ' 0')             
> eval                    logtext = %trimr(logtext) + ', ' + lyyyy 
> eval                    logtext = %trimr(logtext) + ' at ' 
> eval                    #time  =  %editw(Lhhmmss : '0 :  : 
> eval                    logtext = %trimr(logtext) + ' ' + #time    
> 
> LOGTEXT = 'TRRSF999P was rebuilt on May 28, 2000 at  1:06:47 ' 
> 
> Thanks for looking at this 
> Steve 
> 
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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.