The content of alphanumeric literals, comment lines, and comment entries can include any of the characters in the computer's compile-time character set, and can include both single-byte and DBCS characters.
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
Are you attempting to eliminate and replace unwanted characters from a given COBOL field?
This can be done easily with an INSPECT CONVERTING, using a 256-byte FROM table consisting of X'00' through X'FF' values and a 256-byte TO table (initialized to SPACES) and then populated with the byte-values you want to keep. All other byte-values are converted to SPACE.
For example, in the TO table, you want to keep all NUMERICS, 0-9, so you move bytes 241 through 250 of the FROM table to bytes 241 through 250 of the TO table, before issuing the INSPECT.
Same concept applies to upper and lower-case letters and other "keepers"....