Page 1 of 1

shell script to convert comp-3( packed decimal) to ASCII

Posted: Thu Aug 02, 2007 3:09 pm
by develop
I need to convert the comp-3 data ( packed decimal ) to ASCII
The record lenght is fixed(COBOL FILES).
This should be done using a shell script rather than
a DS job

any help is greatly appreciated

Posted: Thu Aug 02, 2007 3:44 pm
by ArndW
Develop - Your company has bought an expensive and powerful tool and now wishes to perform one of the built-in functions via the scripting funciton of the operating system. This is silly!

The COMP-3 is a binary coded decimal format that is very easy to convert in most languages. Doing so in script is tougher and much less efficient. A quick Google! shows that there solutions out there, including the this one but they are going to horrendously slow.

Your quickest solution outside of DS is to write a 1-liner in COBOL (well, nothing is a 1-liner in COBOL once you define all your divisions/sections) to move the COMP-3 to a COMP field.

Posted: Thu Aug 02, 2007 4:06 pm
by ray.wurlod
This is built-in functionality in the Complex Flat File stage!