I have written a cobol program where I should read a VSAM file and convert the file into CSV format. So I just read a file and write it into the output file with commas. But my input file has COMP/COMP-3 variables. When I export the file into excel, I am seeing junk values for COMP/COMP-3 variables. Can any one help me in code how to convert the comp variables to numeric and write into a file to avoid junk in excel sheet?
Excel won`t be able to understand the comp fields so while you are importing your data into excel it is showing junk value.It only understand numeric or character fields.So best way to import correct value of the comp field into excel is to first store your comp field either in a pure PIC 9 or PIC X field and then create the output file and subsequently you can import it in excel.That is what i do while i transfer any MF file which contains comp data into excel.