I was getting an issue where I tried copying data from a text file in IFS to the DB2-based DDS file and the data was not copied correctly. After looking at the data as hex values I got to know that the spaces are replaced in the file field data as below:
spaces X’4040′
replaced with X’0D25′
where 0D
is carriage return
and 25
is line feed
character.
What should I do now, Is there any way to replace hex values in a file field using SQL?
You can use this SQL to replace the
carriage return
andline feed
characters (X’0D25′
) with spaces (X’4040′
).Note: Please take a backup of your file before running the update to verify your results and in case any issue occurs you may then be able to restore your original file data.