Re: preguntas sobre la selección de operación lógicaisMissing (x) devuelve 1 si x falta, 0 si x no falta. También puedes usar
isMissing (x) sin compararlo con 1 o 0; el valor devuelto es el mismo, pero podría ser más fácil de leer:
If( :Height > "60" & isMissing( :Weight ) , ... )
or
If( :Height > "60" & ! isMissing( :Weight ) , ... )
Observe la ! lo que significa no .
Re: preguntas sobre la selección de operación lógicagracias funcionapreguntas sobre la selección de la operación lógicaCuando uso el siguiente script, la fila 4 no cambia a "sí", pero otras filas cambian. ¿Ayudarías a verificar de nuevo? Mi propósito es darme cuenta de que cuando: Altura> "60" & (y) isMissing (: Weight) == 0, ambos se dan cuenta, luego el valor de altura cambia a "Sí", otros valores no cambian en altura.
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"
)
);
