Re: questions about logic operation selectionisMissing(x) returns 1 if x is missing, 0 if x is not missing. You can also just use
isMissing(x) without comparing it to 1 or 0; the returned value is the same, but it might be easier to read:
If( :Height > "60" & isMissing( :Weight ) , ... )
or
If( :Height > "60" & ! isMissing( :Weight ) , ... )
notice the ! which means not .
Re: questions about logic operation selectionthank you it worksquestions about logic operation selectionWhen i use below script, the row 4 not change to "yes", but other rows change. Would you help check again? My purpose is to realize that when :Height > "60" &(and) isMissing( :Weight ) == 0, both realize, then the height value change to "Yes", other values no change on height.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Set the value of JACLYN's weight to missing
// to allow for the test case, where the
// :Height is greater than 60, but the :Weight
// is missing
dt:Weight[4] = .;
// Since the column :height is numeric and a
// character value of "Yes" is to be placed in
// that column, the column needs to be changed
// to Data Type of Character
dt:Height << data type(character);
// Now a For Each Row() with a two level
// comparison can be used to change the
// described value
For Each Row(
If( :Height > "60" & isMissing( :Weight ) == 0,
:Height = "Yes"
)
);
