Data editing > Writing out data > Default print parameters for write statements
 
Default print parameters for write statements
Quick reference
To define default print parameters for write statements, type:
ident[±] [$text$] [,variable_name] [,variable_name, ...]
Any number of texts, variable names and fields are allowed. Items are printed in the order they are listed.
To turn off ident defaults and return to the standard write behavior, type:
noident
More information
The ident statement gives you increased control over the content of the print file by allowing you to print more than one field of columns and one text per write statement.
Each ident statement may contain any number of texts, variable names and columns as long as each one is separated from the others by a comma. The order in which you define items with this statement controls the order in which they will be printed. For example, if you type:
ident $bad movie code$, c(1,10)
if (movies0 .gt. 0) write $check c(1,6)$
and Quantum finds a record which fails this test, it prints the following:
bad movie code
Column c(1,10) is |----+----|
                   040506
                             check c(1,6)
The text defined with ident does not replace the text given with write. If you do not define a message on the write statement, Quantum prints the complete statement as it usually does.
In this example, there is not much difference between using ident and writing the test as:
if (movies0 .gt. 0) write c(1,10) $bad movie code - check c(1,6)$
The real power comes when you want to write out more than one field and/or text per write statement, or if you want to write out the values of data, integer or real variables. For example, if you type:
ident t1, t2, t3
write
Quantum writes messages of the form:
t(1) is 10
t(2) is 15
t(3) is 20
in the print file (the values reported are, of course, be the values of the variables as they are in your run).
Note In ident statements, you can refer to a field of adjacent entries in a data variable array by specifying the first and last entries. For example, you can specify c(1,12) to refer to columns 1 through 12 of the C array. However, like most other Quantum statements, you cannot use this syntax for other types of variable, such as integer arrays.
So the example above must be specified as:
ident t1, t2, t3
and not as:
ident t(1,3)
You can combine texts, columns and variable names. The statements:
ident $Bad movie code$, c(1,10), movies0, movies1, movies2, movies3
if (movies0 .gt. 0) write
might print:
Bad movie code
Column c(1,10) is |----+----|
010209
if (movies0 .gt. 0) write
movies(0) is 1
movies(1) is 1
movies(2) is 1
movies(3) is 0
You could use this type of output for checking records which may be incorrectly coded for use with field and bit statements. For information about field, see Reading numeric codes into an array. For information about bit, see Responses with numeric codes: bit.
When ident writes out data variables, it prints the data according to the specification on the filedef statement for the file to which you are writing the data. If the filedef statement includes the keyword norule to suppress the ruler, the data is written out without a ruler, otherwise the ruler is always printed above the data, as in the previous example.
You can alter this behavior without having to respecify the filedef command by typing a + or - sign at the end of the ident keyword. If filedef normally requests a ruler, type:
ident- data variables
to print the listed variables without a ruler. If filedef normally suppresses the ruler, type:
ident+ data variables
to print the variables with a ruler.
To switch off ident and revert to the standard write behavior, type:
noident
See also
Writing out data