× 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: %REPLACE is being obstinent
  • From: Scott Mildenberger <Smildenber@xxxxxxxxxxxx>
  • Date: Fri, 10 Nov 2000 10:50:24 -0700

I was able to type in your code and it compiled fine on our system (V4R3).
At first I cut and pasted your code from the e-mail and I could not get SEU
to accept any of the lines at all, almost like there were some 'weird'
undisplayable characters in the lines somewhere.  In fact, at one time SEU
gave me an error with the same wording as your compile error.  That could be
a function of cutting and pasting but usually that works fine.  Just for
grins, you might try retyping the lines in question and see if that clears
it up.  Otherwise I'm not sure what's going on.

Scott Mildenberger

> -----Original Message-----
> From: Steve Moland [SMTP:Steve@Accessp.com]
> Sent: Friday, November 10, 2000 9:31 AM
> To:   'rpg400-l@midrange.com'
> Subject:      %REPLACE is being obstinent
> 
> The goal is to replace X number of trailing bytes in a string with Nulls. 
> The field 'Offset' is the place to start inserting the Nulls. I could have
> initialize 'outstr' to Nulls before I start filling the string but I need
> to do the null thing only on the final time 'outstr1' is used and it may
> be used 1 to a millions times.
> 
> The following code produces the compiler error shown at the end. I've
> tried using a character field in place of the constant NULL just in case
> it doesn't like constants. 
> 
> D Null            C                   X'00' 
> D Offset          S              4  0  
> D Outlen          S              4  0 Inz(%len(Outstr1)) 
> 
> D OutStr          DS          4096 
> D  OutStr1                1   2048 
> D  OutStr2             2049   4096 
> 
> eval      outstr1 = %replace(Null:   
>                           outstr1:             
>                           offset:              
>                           outlen - offset + 1) 
> 
> 
>     319 c                   .eval                      outstr1 =
> %replace(Null:                                          032000 
> 
>  ======>                                                         aaaaaaaa
> b                                                 
> 
>  *RNF0604 20 a      032000  The token is not valid; token is ignored.
> 
> 
>  *RNF0312 20 b      032000  A right parenthesis is expected but is not
> found.      
> 
> Steve Moland 
> Access Paths Inc                                                 
>   
> 
+---
| 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.