该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


set_y = Associative Array( {"chair", "person", "relay", "snake", "tripod"} );
set_z = Associative Array( {"person", "snake"} );
set_w = Associative Array( {"apple", "orange"} );
"\!NExample:\!N\!tset_y = ",
set_y << Get Keys,
"\!N\!tset_z = ",
set_z << Get Keys,
"\!N\!tset_w = ",
set_w << Get Keys
set_z << Insert( set_w );
Write( "\!N\!NUnion operation (set_w, set_z):,\!N\!tset_z = ", set_z << Get Keys );
set_y << Remove( set_z );
Write( "\!N\!NDifference operation (set_z from set_y):\!N\!tset_y = ", set_y << Get Keys );
set_w << Intersect( set_z );
Write( "\!N\!NIntersect operation (set_w, set_z):\!N\!tset_w = ", set_w << Get Keys );
Given a list of names, which of them are not contained in Big Class.jmp? You can find the answer by taking the difference of the two sets of names.
names list = {"ROBERT", "JEFF", "CHRIS", "HARRY"};
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
names = Associative Array( names list );
names << Remove( Associative Array( dt:name ) );
Write( "\!NWhich of {ROBERT, JEFF, CHRIS, HARRY}, is not in Big Class = ", names << Get Keys );