Processing or removing delimited characters from work files

We have a file that is passed to us with delimited data. The character that separates each portion of data is a double quote ". Is it possible to remove those quotes via a Natural program (for example…using the examine statement)? Is there another method?

Sure enough, you can use this to separate the string:

separate #STRING into #F1 #F2 #F3 #F4 with delimiter '"'

or something like this to replace the double quotes with slashes:

examine #STRING for '"' replace '/'

Whether the character " is single or double quote is controlled by the TQ parameter (afaik default is ON). If it is ON, double quotes are translated into a single quote (sigh!).

To be independent from that (imho nonsense ) parameter you should use the binary representation of that character. In EBCDIC it is H’7F’. But you will loose portability then (different representation in ASCII.

BTW. The separation character " is very unusual. I know, that in CSV often the text fields are surrounded by ", But the delimiter is a comma or semicolon. If you have this, then a separate only will not work!

You could set the delimiter parameter (ID=") and pass the file to CMOBJIN. Process the records with INPUT field1 field2 … within a REPEAT loop.

If this is truly a delimited file, then the fields will be of variable length, and removing the delimiters would render the file impossible to process.

If the fields are really of fixed length (for example, created by a COMPRESS FULL), then is there a need to delete the delimiters? You can define your data area (record definition) with FILLERs to match the positions of the delimiters, thereby ignoring them.