cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
nikles
Level VI

Controlling the .jmp suffix at end of table names

Hi.  Does anyone know how to control if the ".jmp" extension appears at the end of your table name when opened?

 

I've noticed when I open some tables it's there, but on other tables, not.  I do not know why.  I'm writing a script that uses the table name and I need it to be consistent. Is there a preference I can use to control it, or some command?  I have considered just arbitrarily stripping the .jmp from all tables if found, but this is not my first preference.

 

JMP Pro 15.2.1 

Mac OS Big Sur 11.6

1 REPLY 1
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Controlling the .jmp suffix at end of table names

Hello @nikles,

This doesn't directly answer your question but I suggest avoiding references to tables by name.   The most common issue I see is someone already having a table open with the name you are interested in, or a future change to your script having unintended consequences.  Instead, you can save a reference to that table and use that in the rest of your script.  If you are counting on the user already having a specific table open, you can search for it. Here are some examples:

Names default to here(1);

dt1 = Open( "$Sample_data/iris.jmp" );
dt1 << Set Name("iris2");
dt1 = Open( "$Sample_data/iris.jmp" );
dt2 = Open( "$Sample_data/big class.jmp" );

//Get first matching table
dt3 = filter each({dt}, Get data table list(), Contains(dt << get Name,"iris"))[1]

//or ask the user which one to use
TableList = filter each({dt}, Get data table list(), Contains(dt << get Name,"iris"));
winSelectTable = New Window("Which Table?", << Modal, << Return Result,
	lbTable = List Box(TableList)
);
dt3 = filter each({dt}, Get data table list(), (dt << get Name) == winSelectTable["lbTable"][1])[1];

//Now always refer to that table using the table reference
dt3 << Distribution( Continuous Distribution( Column( :Sepal length ) ) );

//If making new tables in your script, you can usually get those references
//from the functions that create them:
dt4 = (dt3 << Tabulate(
	Show Control Panel( 0 ),
	Add Table(
		Column Table( Analysis Columns( :Sepal length ) ),
		Row Table( Grouping Columns( :Species ) )
	)
)) << Make Into Data Table;

dt4 << Get Name()'

n, you can search for it first and then use a reference after that.