|
Yes, a kludge. It has something to do with the way RPG handles variable lengths in the Eval statement. Just for the heck of it, make the length of Logtext something like 75, and see if the whole string doesn't then show up. Odds are, it will. I can't explain why this is so, as I don't fully understand it, but this might do it for you. Have you considered making logtext a variable length string? That would probably do it also. Regards, Jim Langston Steve Moland wrote: > > > 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 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.