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

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
develop
Premium Member
Premium Member
Posts: 7
Joined: Fri May 26, 2006 4:34 pm

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

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is built-in functionality in the Complex Flat File stage!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply