cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
Ake
Ake
Level IV

What is the best way to rename a data table without ruining saved scripts?

When I write reports I embed the data table into the word document in a zip-file, so that future readers can extract the data. When I am about to do that I often realize the the name of the data table was chosen hastily, so I want to give it a better name before saving into the report.

 

The problem I run into is that some (not all) of the scripts I have saved along the way contains the name of the data table., with the result that hose scripts stop working.

 

Is there a way to rename the data table without running into this problem?

 

1 REPLY 1
Byron_JMP
Staff

Re: What is the best way to rename a data table without ruining saved scripts?

If you want to be super robust about your scripts saved to a data table, you could add a little JSL:

 

//something like this
dt=current data table(); dt<< Distribution(Continuous Distribution( Column( :Protein ) ));

If you're not working with scripts saved to a data table. It is often a very good idea to replace the explicit data table names with a variable so that if the table name changes (e.g. gets appended to) then the script will work.

 

 

Data table("emanon")  is an explicit table name.

dt=open("emanon.JMP"); is a reference to the table name.  When dt is evaluated it is: data table("emanon"), but in all your scripts it's just dt.  

 

 

//original script

Data Table( "trends.jmp" ) << Stack(
	columns( :Protein, :Purity ),
	Drop All Other Columns( 1 ),
	Output Table( "Stack of trends (Protein etc.)" )
);

//edit to variable references

dt=current datatable(); //or some other way to reference the table you're acting on
dt1=dt<< Stack( columns( :Protein, :Purity ), Drop All Other Columns( 1 ), Output Table( "Stack of trends (Protein etc.)" ) );

although the table name is "Stack of trends (Protein etc.)" the reference for the new table is dt1, which has the added bonus of being much easier to type than the entire table name (that I would misspell and break the script).

 

 

JMP Systems Engineer, Health and Life Sciences (Pharma)

Recommended Articles