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
Mikasa
Level II

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

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)