I have tried a lot and am not able to achieve this.
Using DFSORT SORT step, I have created an xml output file. But if my output file had any of these characters '&', '<', '>', ''' (single quotes) or '"' (double quotes) then the xml fails to open.
If my data is wrapped between '<![CDATA[' and ']]>' tags, then I won't have a problem. But when I did this, the '[' and ']' characters came out as junk characters and xml failed again.
This is what I get:
Instead of using CDATA tags, there will not be any problem, if I replaced:
'&' with '&'
'<' with '<'
'>' with '>'
''' with '''
'"' with '"'
I tried using CHANGE= option, but if I do not know the position of these characters in my file (say, these characters can be anywhere from 1 to 20th position in my input file), then how do I achieve this?
Can any of you help me with any of my options (or is there any new option for me)?