|
I might try code like this: C Eval Inx = 1 C Do 30 C If %SubSt(testField:Inx) >= 'a' C Or %SubSt(TestField:Inx) = *Blank C Eval NewField = %Trim(NewField) + %SubSt(TestField:inx) C EndIf C Eval Inx = Inx + 1 C EndDo I say "like this" because you need to deal with '~', '{', and '}' (they're above 'a" in the collating table) and you have to deal with the blanks because the %Trim will remove them, both trivial exercises left for the reader. The C DO 30 = (length of the field to be tested) --------------------------------------------------------- Booth Martin http://www.MartinVT.com Booth@MartinVT.com --------------------------------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: Tuesday, January 14, 2003 06:35:24 PM To: RPG programming on the AS400 / iSeries Subject: Removing punctuation (not using arrays) If I have this field value "RABBIT PACK, 6PC. WINE TOOL KIT", is there a better method of removing the comma and period characters and discarding the extra spaces created without using an array routine of reading one byte at a time, translating the unwanted characters to "blanks" and then reloading the field via array positions? Can I use the %xlate and %trim %bifs to shorten this task? I don't have REXX so that is not an option. Tracy L. Ball Total Response, Inc. Sr. Programmer/Analyst (317) 781-4600 ext. 3107
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.