cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar

How to include another script in current script

Hello all,

 

I have two scripts A and B. Script A and B both use the same data table. And what script A can do is updating columns for the data table. 

 

I want to open the data table, call script A, and then use the table from script A to do the future analysis. But my code doesn't work. 

 

Below is a part of my script. I think the script A is called successfully, but the script after include function can't work. It is my first-time use include function. Can someone help me with it?

 

I appreciate your help a lot!

 

dt_template = Current Data Table();

dt_template = include("XXX");

dt_template << New Column( "L",
Character,
Nominal,
Formula(

),
eval formula
);

1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli
Level VIII

Re: How to include another script in current script

@Anonymous, 
             You may use the Include() to achieve what you want. One suggestion I would offer is look at expressions as well. You can achieve better control over your code by making it as expressions. However, here is one way to  achieve what you want, this goes into "Wrapper.jsl" 

 

Clear Log(); Clear Globals(); Close All(DataTables,"No Save"); 

dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

Include("C:\Script A.jsl"); // put your custom file path where you save Script A 

Wait(0.2); // For demo purposes 

Include("C:\Script B.jsl"); // put your custom file path where you save Script A  

 

Best
Uday

View solution in original post

2 REPLIES 2
uday_guntupalli
Level VIII

Re: How to include another script in current script

@Anonymous, 
             You may use the Include() to achieve what you want. One suggestion I would offer is look at expressions as well. You can achieve better control over your code by making it as expressions. However, here is one way to  achieve what you want, this goes into "Wrapper.jsl" 

 

Clear Log(); Clear Globals(); Close All(DataTables,"No Save"); 

dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

Include("C:\Script A.jsl"); // put your custom file path where you save Script A 

Wait(0.2); // For demo purposes 

Include("C:\Script B.jsl"); // put your custom file path where you save Script A  

 

Best
Uday
jj_jmp
Level II

Re: How to include another script in current script

Thanks! Small typo: last comment should be " ... save script B"  :)