DB2 Version 9.7 for Linux, UNIX, and Windows

Non-delimited ASCII (ASC) file format

The non-delimited ASCII format, known as ASC to the import and load utilities, comes in two varieties: fixed length and flexible length. For fixed length ASC, all records are of a fixed length. For flexible length ASC, records are delimited by a row delimiter (always a new line). The term non-delimited in non-delimited ASCII means that column values are not separated by delimiters.

When importing or loading ASC data, specifying the reclen file type modifier will indicate that the datafile is fixed length ASC. Not specifying it means that the datafile is flexible length ASC.

The non-delimited ASCII format, can be used for data exchange with any ASCII product that has a columnar format for data, including word processors. Each ASC file is a stream of ASCII characters consisting of data values ordered by row and column. Rows in the data stream are separated by row delimiters. Each column within a row is defined by a beginning-ending location pair (specified by IMPORT parameters). Each pair represents locations within a row specified as byte positions. The first position within a row is byte position 1. The first element of each location pair is the byte on which the column begins, and the second element of each location pair is the byte on which the column ends. The columns might overlap. Every row in an ASC file has the same column definition.

An ASC file is defined by:
ASC file ::= Row 1 data || Row delimiter ||
             Row 2 data || Row delimiter ||
             .
             .
             .
             Row n data
 
Row i data ::= ASCII characters || Row delimiter
 
Row Delimiter ::= ASCII line feed sequencea