Can someone please help me with creating a comma separated file in COBOL.
In the program we have the following layout of the record that needs to be converted to comma separated file before being written to the output file.
05 var1 pic x(5)
05 var2 pic X(9)
05 var3 pic 9(5)
05 var4 pic 9(9)
05 var5 pic x(5)
05 var6 pic X(1)
So say we have the record data as: abcd(1 space)(9 spaces)(2 spaces)123(9 0's)(5 spaces)(1 space)
This will look like: abcd xyz 123000000000
We need to remove all spaces and 0's. Also the last byte - Var6 must be spaces. Since we need a comma separated file in the output file, the record should appear as shown below in the output file;
Please let me know how best this can be achieved in a cobol program.