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



In this situation, why not just use eval?

> C                   eval      co2namv = co2nam

Phil

> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
> Behalf Of Frank.Kolmann@revlon.com
> Sent: Thursday, March 07, 2002 5:18 PM
> To: rpg400-l@midrange.com
> Subject: MOVE/MOVEL and %Scan
>
>
> Ditto.
> I am using varying length fields to check if a string
> exists in some other field.
> I am having to set the length of the varying field
> before I do a MOVEL.
> I thought I was imagining things where the MOVEL
> itself was previously setting the length.
> I dont mind setting the length as it makes the code
> obvious as to what I am intending.
>
> D  C02NAMV        S             32    VARYING
> D  C02NAM         S             30
>
> C                   Eval      %len(C02NAMV)  = %len(%trim(C02NAM))
> C                   MOVEL     C02NAM        C02NAMV
> C                   Eval      pos = %scan(C02NAMV : S02NAM)
>
> Frank Kolmann
>
>
> Paul Nicolay wrote:
> >Hi Barbara,
> >
> >Have things changed, or do I get old ?
> >
> >I guess I once tested MOVEL on a VARYING field, and got the
> result that it
> >also overwrote the first two bytes containing the length of the VARYING
> >field ?  Has this ever been the case, or is my memory really failing ?
> >Anyway, even like it is currently, I find it a dangerous construction as
> one
> >doesn't really know if the length of the data to MOVE will be the same as
> >the current length of the VARYING field (unless one anticipates such
> >behavior... but I consider that as "to be avoided implicit behavior")
> >
> >I also encountered another issue that seems to be running fine now ?  In
> the
> >past when I was doing a %Scan and the search argument was bigger than the
> >actual VARYING string, the program crashed.  If I now try this...
> everything
> >goes fine (and it returns 0... as it should be in my opinion).  Again, am
> I
> >getting old ?
> >
> >Kind regards,
> >Paul
>
> _______________________________________________
> 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.
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.