× 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: %REPLACE is being obstinent
  • From: Steve Moland <Steve@xxxxxxxxxxx>
  • Date: Fri, 10 Nov 2000 11:30:52 -0500

Title: %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                                                
 


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.