Data editing > How Quantum reads data > Describing the data structure > Record length
 
Record length
Quick reference
To define the record length of records greater than 100 columns, type:
struct; reclen=n
More information
The keyword reclen=n defines the maximum number of characters to be read into the C array, the number of cells to be reset to blanks and the number of cells to be written out by the write statement.
With ordinary records, reclen may take any value; with multicard records, the maximum is 1000. In both cases, the default is 100. When data is read into the array, any record which is longer than reclen characters is truncated to that length and a warning message is printed.
When ordinary records are written out with write or split, cells c1 to c(reclen) are copied, with any trailing blanks being ignored. For example, if you have:
struct;read=0;reclen=200
and the current record is only 157 characters long, the record written out is 157 characters long. This length can be overridden by an option on a filedef statement.
When multicard records are written out, columns c101 to c(100+reclen), c201 to c(200+reclen), and so on will be output. Thus, if you write:
struct;read=2;reclen=70
and you have 2 cards per record, Quantum writes out c(101,170) and c(201,270).
With ordinary records cells c1 to c(reclen) are reset to blanks between records, but with multicard records cells c101 to c(100+reclen), c210 to c(200+reclen), and so on are reset.
More information
For information about the write statement, see Print files.
For information about the split statement, see Creating clean and dirty data files.
For information about the filedef statement, see Defining the file type.
See also
Describing the data structure