The RPG code:
FVALUESFMCF E WORKSTN
E CF 30 1
E CT 30 1
E OK 70 1
I 'ABCDEFGHIJKLMNOPQRST-C NCOK
I 'UVWXYZabcdefghijklmn-
I 'opqrstuvwxyz'
C* ..................................................
C *INKC DOUEQ*ON
C EXFMTFMT01
C *INKK IFEQ *OFF
C EXSR DOITSR
C ELSE
C EXSR TOGGSR
C END
C END
C MOVE *ON *INLR
C* ....................................................
C* : S U B R O U T I N E S :
C* ::::::::::::::::::::::::::::::::::::::::::::::::::::
C* Accept only the characters appearing in array OK:
C DOITSR BEGSR
C MOVE *OFF *IN41
C MOVE *OFF *IN42
C MOVE *BLANKS CF
C MOVE *BLANKS CT
C MOVEASHOWOK OK
C SORTAOK
C MOVEAOK SHOWOK
C SHOWOK IFEQ *BLANKS
C MOVE *ON *IN42 ERROR 42
C ELSE
C FIELD IFEQ *BLANKS
C MOVE *ON *IN41 ERROR 41
C ELSE
C* I is the column # of the field we are checking;
C* J is the column # of the field to which we are writing:
C Z-ADD1 I 20
C Z-ADD1 J 20
C MOVEAFIELD CT
C* The array CT is 30 columns long; we need to check all 30 columns.
C DO 30
C CT,I LOKUPOK 61 61=yes
C* 61 = The character is in the array:
C *IN61 IFEQ *ON
C FLDA ANDEQ'Include'
C EXSR FILLSR
C END
C *IN61 IFEQ *OFF
C FLDA ANDEQ'Exclude'
C EXSR FILLSR
C END
C* Now, get the next column's character to process:
C ADD 1 I
C END
C* _____________________________________________________________
C* The array CF now holds the new field as we want it, so we are
C* moving the new field back into the original field to display it.
C MOVE *BLANKS FLD004
C MOVEACF FLD004
C MOVE *BLANKS SHOWOK
C MOVEAOK SHOWOK
C END
C END
C ENDSR
C* ::::::::::::::::::::::::::::::::::::::::::::::::::::
C* Toggle include/exclude:
C TOGGSR BEGSR
C FLDA IFEQ 'Include'
C MOVE 'Exclude' FLDA
C MOVE 'Include' FLDB
C ELSE
C MOVE 'Exclude' FLDB
C MOVE 'Include' FLDA
C END
C ENDSR
C* ::::::::::::::::::::::::::::::::::::::::::::::::::::
C* Fill an array with desired characters:
C FILLSR BEGSR
C* Move the character into the next available
C* column of the array CF, and increment CF's counter.
C MOVE CT,I CF,J
C ADD 1 J
C ENDSR
C* ::::::::::::::::::::::::::::::::::::::::::::::::::::
C* Initialization sub-routine
C *INZSR BEGSR
C MOVE 'Include' FLDA 7
C MOVE 'Exclude' FLDB 7
C MOVELNCOK SHOWOK
C EXSR DOITSR
C ENDSR
C*-------------------------------------------------------------------
|