cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

Ho to make the script continue running after encountering a non-present column?

Mikasa
Level II

Hi everyone

I have a data table with a lot of columns. in my script I name some of them and make a new table to plot the graphs.

the data get updated every day for last 90 days. sometimes in happens that one of the column does not present in the data table in the updated data since it was not running on the tool for a while. the script stops when encounters to naming that non-present column. 

How I can make the script continue running and skip that non-present column?

 

Thanks

2 REPLIES 2
Jeff_Perkinson
Community Manager Community Manager


Re: Ho to make the script continue running after encountering a non-present column?

You'll want to use the Try() function.

 

You can read more in the Throwing and Catching Exceptions part of the Scripting Guide.

-Jeff
Byron_JMP
Staff


Re: Ho to make the script continue running after encountering a non-present column?

I just happened to be working on a script that has that exact same problem.

I used the approach the @Jeff_Perkinson  referenced above

for (i=1, i<=nitems(fixlist), i++,
	try(fixlist[i]<<Set Modeling Type( "Continuous" )); // Try() ignores errors, so if a column isnt there it still runs
	try(fixlist[i]<<Set Data Type( numeric));
)
JMP Systems Engineer, Health and Life Sciences (Pharma)