newbadval [ parameter=value ... ] [ inputfile ... ]
Parameters are: include_vars, bad_value.
newbadval changes a variable's bad (missing) value. Both the variable's data and the variable's bad value attribute are changed.
This differs from the editvar function, which can change only a variable's bad value attribute, but not its data.
Note, a variable can have more missing values after running newbadval than before. This may or may not be desireable. See the example below.
The following example shows how to use newbadval. The variable in testdata initially has a bad value of 3. When the bad value is changed to 5, the number of missing values increases from 4 to 8.
% printvar testdata
include_vars : char(255) ? []
line_per_elem : char( 3) ? [yes] n
list_dims : char( 3) ? [yes]
printout : char( 3) ? [no]
Printvar testdata Page 1
x
1 0 1 2 *** 4
2 1 2 *** 4 5
3 2 *** 4 5 6
4 *** 4 5 6 7
5 4 5 6 7 8
%
% newbadval testdata
include_vars : char(255) ? []
bad_value : real ? 5
%
% printvar testdata
include_vars : char(255) ? []
line_per_elem : char( 3) ? [yes] n
list_dims : char( 3) ? [yes]
printout : char( 3) ? [no]
Printvar testdata Page 1
x
1 0 1 2 *** 4
2 1 2 *** 4 ***
3 2 *** 4 *** 6
4 *** 4 *** 6 7
5 4 *** 6 7 8
%
% contents testdata
printout : char( 3) ? [no]
Contents of File: testdata Page 1
Dimension Size Coord Scale Offset
line 5 y 1 0
sample 5 x 1 0
Attribute Type Units Value
history byte
Variable Type Units
x byte
Variable Dimension Size
x line 5
x sample 5
Variable BadValue ValidMin ValidMax Scale Offset
x 5 0 255 1 0
Last Update: $Date: 1999/05/10 20:45:31 $