×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) 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                                                
 


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.