cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

Hi,

 

I have encountered this problem when I run a old script on JMP 15. Anyone can help me to solve this problem? Thank you in advance!

 

PearsonEagle535_0-1650386562495.png

 

6 REPLIES 6
txnelson
Super User

Re: JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

Thid error occurs when the argument to the function is blank.  The example below will throw that error:

r="";
current data table(r);
Jim
Thierry_S
Super User

Re: JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

 Hi,

Could you share the portion of the script that triggers the error?

One obvious but unlikely issue might be that you do not have any table opened when you invoke the Current Data Table function. 

Also, if you want to define a specific table, use the Data Table ("name") function instead of Current Data Table.

Best,

TS

 

Thierry R. Sornasse
Georg
Level VII

Re: JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

You may want to activate "Show embedded Log" in the Script Window (by right clicking, or setting this in the preferences.

Then the Log tells you at which Line this error occurs.

You can check the prerequisites (if variables are populated with the expected values) by hovering over the variable name, it will show the value. The snippet I borrowed from @txnelson - Thanks.

 

Georg_0-1650406306518.png

 

Georg
StarfruitBob
Level VI

Re: JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

I also get this error.  The log shows:
******
Argument must contain data table reference in access or evaluation of 'Current Data Table' , Current Data Table/*###*/(dt1)

 

at line 1 in Script for MyData

******

Line 1 in my script is:

Current Data Table(dt1);

 

I'm running the script on a table that's open.  It's the only data table open.  Any ideas?

Learning every day!
StarfruitBob
Level VI

Re: JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

Interesting, for my specific usage I was able to leave Current Data Table() empty to successfully run the command with the desired output. My guess is what if the table you intend to run this script on is on top, that you should be able to leave the argument empty.

Learning every day!

Re: JMP alert: Argument must contain data table reference in access or evaluation of 'current data table', current data table/*###*/(dt1)

When you run Current Data Table() with no argument, it returns a reference to the current table.  When called with an argument, it should be a reference to an open data table.  Here is another example that will give the error in question, on the second call to Current Data Table(dt1):

dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
Show(Type(dt1)); // "Table"
Show(IsEmpty(dt1)); // 0
Current Data Table(dt1); // ok
Close(dt1);
Show(Type(dt1)); // "Table"
Show(IsEmpty(dt1)); // 1
Current Data Table(dt1); // gives error

As mentioned by @Georg above, after running the script you can hover over variables in the script to get some information, or use the embedded log to query the values.  If you highlight the dt1 variable and evaluate (run) the script, the log will display:

 

Data Table( "UnknownTable" )

In the example above, I also use IsEmpty(dt1) to show one way that you can detect with JSL that the variable refers to an object that no longer exists.