|
On Thu, 20 Dec 2001 u.ratay@abus.de wrote:
>
> I have to delete the blanks in a field. For example:
> Field A (before) : '111 222 333 '
> Field B (after) : '111222333 '
>
Depends on what you consider simple :) I'd write a quick sub-proc
and throw it into a "utility service program", so that you always have
it available.
Here's a quick one I wrote (in the last 3 minutes) that will do what
you're asking:
H DFTACTGRP(*NO) ACTGRP(*NEW)
D NoBlanks PR 32766A varying
D Input 32766A const varying
c eval Msg = NoBlanks('12 34 56')
c dsply msg 52
c eval Msg = ' 1234567890--'
c eval Msg = NoBlanks(Msg)
c dsply msg
c eval Msg = ' 1234 56 7890--'
c eval Msg = NoBlanks(Msg)
c dsply msg
c eval Msg = '111 222 333'
c eval Msg = NoBlanks(Msg)
c dsply msg
c eval *inlr = *on
P NoBlanks B
D NoBlanks PI 32766A varying
D Input 32766A const varying
D Output S 256A varying
D X S 10I 0
c eval %len(Output) = 0
c for x = 1 to %len(Input)
c if %subst(Input:X:1)<>' '
c eval output = output + %subst(Input:X:1)
c endif
c endfor
c return output
P E
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.