表格帮助
dt = current data table();
dt << subset(by(:p20000), All Rows, All Columns);
//When I subset dt by :p20000, it outputs atmost 3 data tables ‘p20000=1000’, ‘p20000=1001’, ‘p20000=1002’.
//What I do next is to check if such dt exists
exist= Try(Data Table("P20000=1002");tableExist = 1,tableExist = 0);
);<BR /><BR />//if tab_1002,<BR />tab_1002=expr(insery my long script here);<BR />//if tab_1001,<BR />tab_1001=expr(insert script here);因此,如果存在p20000 = 1002,我将使用表达式tab_1002,
如果存在p2000 = 1001,我将使用表达式tab_1001。
但是,在某些情况下,子集化时仅存在数据表p20000 = 1000。
我很困惑如何根据条件来做这些。
回复:帮助表您可能可以使用这种方法:
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dtList = dt << subset(by(:sex), All Rows, All Columns);
for(t=1, t<=NItems(dtList), t++, Print(dtList[t] << getName));