Subscribe Bookmark RSS Feed

can this jmp script accept arguments from dos?

mwilli13

Community Trekker

Joined:

Mar 1, 2016

I'd like to have the cm8taccformula.txt and cm16taccformula.txt be arguments from a dos window without opening the script. Only the names for the .txt files would change but the rest of the file path would stay the same. Also, can the Set Correlation Function ("Gaussian") become an argument that is input from a dos window? For example, maybe I would want to change it to Cubic.

Thank you for any suggestions!

Names Default To Here( 1 );

dt = Open( "Z:\Documents\test.csv" );

dt << Sort(By("cmux"), order("Ascending"), Replace Table);

dt = Current Data Table();

dt << select where( :cmux == 16 );

dt << hide and exclude;

obj = Gaussian Process(

  Y( :tacc ),

  X( :rows, :cols, :slew, :load, :temp, :volt ),

  Set Correlation Function( "Gaussian" ),

);

obj << Save Prediction Formula;

f = Column( "tacc Prediction Formula" ) << get formula;

t = Char( Name Expr( f ));

Save Text File("C:/Users/username/Documents/cm8taccformula.txt", t );

dt = Current Data Table();

dt << select where( :cmux == 16 );

dt << hide and exclude;

dt = Current Data Table();

dt << select where( :cmux == 8 );

dt << hide and exclude;

obj2 = Gaussian Process(

  Y( :tacc ),

  X( :rows, :cols, :slew, :load, :temp, :volt ),

  Set Correlation Function( "Gaussian" ),

);

obj2 << Save Prediction Formula;

f = Column ("tacc Prediction Formula 2") << get formula;

t = Char (Name Expr(f));

Save Text File("C:/Users/username/Documents/cm16taccformula.txt", t);

dt = Current Data Table();

dt << select where( :cmux == 8 );

dt << hide and exclude;

5 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

JMP's only input from a DOS invocation is a trailing .jsl file that it will run.  So to do what you are indicating you want to do, you would need to have a way to dynamically build the .jsl file to set the parameters you want, and then for the .jsl file to do an "include" to bring in your script.

Other alternative would be for your script to:

1. pop up a user input screen to get the information you want

2. or open a .txt file that was created that contains the information about the parameters

3. Write a VBS  program that dynamically calls JMP


Jim
Craige_Hales

Staff

Joined:

Mar 21, 2013

You might want to explore JMP's automation interface too.  The visual basic idea should play well with automation.

OLE Automation

Craige
pmroz

Super User

Joined:

Jun 23, 2011

You could set environment variables in DOS and then read them in JSL using get environment variable().

Get Environment Variable("PATH");

mwilli13

Community Trekker

Joined:

Mar 1, 2016

I've decided to go with Jim's suggestion of having a user input screen pop up. Can someone fix this script please? I'm trying to have the inputs be assigned to variables, but when I do the show variable command nothing is displayed in the log. The variables aren't being stored properly. I must have something wrong maybe in the syntax, I'm not sure.

The error I get is "The display box 'ButtonBox' does not recognize the message 'Assign'".

Thanks for the help guys!

Names Default To Here( 1 );

New Window("Gaussian Type and Equation filename",

  <<Modal,

V List Box(

Text Box("Gaussian Process Correlation Type (Cubic or Gaussian) for cmux8 and cmux16"),

var1_in=Text Edit Box(),

var2_in=Text Edit Box(),

Text Box("Now Enter Formula Filename for cmux8 and cmux16"),

var3_in=Text Edit Box(),

var4_in=Text Edit Box(),

Show (var1_in);

Show (var2_in);

Show (var3_in);

Show (var4_in);

Button Box ("OK", var1 = var1_in << Get Text (),

var2 = var2_in << Get Text (),

var3 = var3_in << Get Text (),

var4 = var4_in << Get Text (),

),

Button Box ("Cancel")

  )

);

Show (var1);

Show (var2);

Show (var3);

Show (var4);

ian_jmp

Staff

Joined:

Jun 23, 2011

You certainly need to 'glue' together the parts of the script that you want to run when 'OK' is pressed (using ';'). So this part of your code becomes:

Button Box( "OK",

var1 = var1_in << Get Text();

var2 = var2_in << Get Text();

var3 = var3_in << Get Text();

var4 = var4_in << Get Text();

),