Page 1 of 1

Char Datatype for fixed width files

Posted: Thu Jan 26, 2012 12:20 pm
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

Posted: Thu Jan 26, 2012 3:01 pm
by ray.wurlod
Yes, because the Char data type exactly describes the fixed width fields.

Posted: Fri Jan 27, 2012 12:21 am
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.