Data editing > Writing out data > Print files > Writing out parts of records
 
Writing out parts of records
If you do not want to write out the whole record, include a field specification in a write statement to print only selected portions of an incorrect record.
For example:
if (c110'2'.and.c119'2') write c(110,120) $Married woman$
checks that columns 110 and 119 both contain a 2, and if so prints out columns 110 to 120 in the print file, followed by the text Married woman. If you are writing out fewer than ten columns, Quantum does not print a ruler above the codes.
If you are dealing with multi-card records, you might prefer to use this form of write to print only the card containing the error, rather than all cards in the record. For example, the example in Printing out individual records checks the contents of column 308:
if (c308n'1/5') write $c308 incorrect$
prints all three cards in the record, whereas:
if (c308n'1/5') write c(301,380) $C308 incorrect$
prints only card 3.
To write selected parts of a record to a particular file, use:
write filename c(m,n) [$text$]
Note The write statement can only write out information from the C array.
See also
Print files