Char Datatype for fixed width files

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
Maximus_Jack
Premium Member
Premium Member
Posts: 139
Joined: Fri Apr 11, 2008 1:02 pm

Char Datatype for fixed width files

Post by Maximus_Jack »

Hi
Is using char datatype is the best way of reading a fixed width sequential file?
if yes, why.. if not.. what are the other best options..
dr
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, because the Char data type exactly describes the fixed width fields.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Suppose your fixed-width file record length is 120. You can read the data as one field defined as Char(120) or multiple Char fields that total 120. Any mistake in the file where a record has more or less than 120 will be rejected.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply