Use this example that illustrates one way to reverse the reference from the label to the value. (Note: I manually added the Value Label column property to the sex data column so that there was something to work with. That step is not included in the script. You shouldn't need it because your data column already has this property.)
Names Default to Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
label = Arg( dt:sex << Get Property( "Value Labels" ), 1 );
For( i = 1, i <= N Items( label ), i++,
If( Contains( Arg( label[i], 2 ), "female" ),
value = Arg( label[i], 1 );
Break();
);
);
dt << Select Where( :sex == value );