Basically there, but will be simpler if all the quotes are removed first, then all the commas can be changed to tildes. C'' (a character string of no length) indicates the removal of the position occupied by that value. By default the record will be "shuffled" to the left.
Could you please help further in this case. Actually I have got comma , as data in some of the record fields. For example "DOUGL,HARON" in below record. I do not want that , to be replaced with ~. So the input will be as follows:
That'll do it. You PARSE the fields using the comma as a delimiter. Those bounded by quotes, use PAIR to preserve any commas inside. Then BUILD your output, with the tilde between each field. Your quote-protected commas will be preserved that way.
Use the following DFSORT JCL which will give you the desired results. The trick here is to use FINDREP to replace the comma to a space and then use SQZ with PAIR=QUOTE to replace the space with ~. Once that is done we use another SQZ to replace the space within the name to comma. Finally we use another FINDREP to replace the double quotes.