I have an issue: the data I'm feeding to a JSL script comes from an application which sometimes, when has no data to give, returns an empty excel file.
Is there any way to identify this empty table?
If i try to open it, jmp throws out an error and stops the script.
the funcion "is empty" works on open data table and applying it directly on the file give always the same result, regardless if the file is empty or not.
Go to Solution
To avoid stopping of the script you can enclose the open() within a try() statement. To identify an empty Excel table you can try something like this:
If( Is Missing( Try( dt = Open( "/path/file.xls" ) ) ),
Show( "NOOO!, Excel table is empty" ); //...jsl code if empty
Show( "Carry on!" ); //...jsl code if file contains data
thank you! I was looking exactly for something like this, able to handle an error without stopping the execution.
I stumbled upon the try function some time ago, but was unable to find it ..
I will use a simpler form inside a cicle upon a list of files
file = "00_DD_.xls";
Try( dt = Open( file ),flag=1 );
and then use the flag to trigger the creation/modification of a list of "bad files", but substantially relying on the try function