|
Suppose the field name for your phone number is OLDPH, then the code might be
like this
Z-ADD 1 I 10
MOVE *BLANKS NEWPH 8
I DOWLE 8
1 SUBST OLDPH:I CH 1
CH IFNE '-'
NEWPH CAT CH:0 NEWPH
ENDIF
ADD 1 I
ENDDO
In ILE it will be
D pos s 1s 0 inz(1)
D newph s 8a inz(*blanks)
D oldph s 8a inz('123-4567')
D ch s 1a inz(*blanks)
C DOW POS <= 8
C EVAL CH = %SUBST(OLDPH:POS:1)
C IF ch <> '-'
C newph CAT ch:0 newph
C endif
C eval pos = pos + 1
C enddo
Hope it helps.
Amitava
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.