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
LukeFarrell
Level III

JMP14 Script Compatibility with Older Versions

Hi There, 

 

I am looking to see if anyone could give some advice on writing scritps and making them compatible on older versions of JMP. Recently I have been working on a script which converts a cvs file to a data sheet on JMP and setting the different columns to have different properies (such as modelling types, formulae, etc.) It has been working fine on PCs using JMP14, however when a colleague of mine tries to use the script, it does not work. I descovered that he is using JMP13 and when the script runs it does not change the modelling type to "Nominal" but rather "Continuous".

 

Please see the script extract which I am using for the modelling conversion. 

....
New Column( "DateTime",
			Numeric,
			"Nominal",
			Format( "y/m/d h:m"),
			Input Format( "y/m/d h:m:s", 3 )
		),
....

 

I was hoping someone could provide some advice if there is a way to make the script compatable. Any help would be much appreciated.

 

Thank you,

Luke 

~ Luke :)
13 REPLIES 13
LukeFarrell
Level III

Re: JMP14 Script Compatibility with Older Versions

Coming off of this, it seems that the addition of more columns is where my issue arrises, as my original method works using the below script in JMP13.

 

Open(dt,
columns(
		New Column( "DateTime",
			Numeric,
			"Nominal",
			Format( "y/m/d h:m"),
			Input Format( "y/m/d h:m:s", 3 )
		);
		
		
		
	);
	
);
~ Luke :)
Jeff_Perkinson
Community Manager Community Manager

Re: JMP14 Script Compatibility with Older Versions

Here's another test to run in JMP 14 and JMP 13. It works in both for me:

 

Open(
	"$SAMPLE_DATA/../Import Data/BigClass.txt",
	columns(
		New Column( "Name", Character, "Nominal" ),
		New Column( "Date",
			Numeric,
			"Nominal",
			Format( "m/d/y", 10 ),
		),
		New Column( "Sex", Character, "Nominal" ),
		New Column( "height", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "weight", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Tab, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 0 ),
		Column Names Start( 1 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

NB: The column will be filled with missing values since it's not a date value. That's okay since it's not what we're testing. We just need the column to be a Nominal modeling type.

-Jeff
Jeff_Perkinson
Community Manager Community Manager

Re: JMP14 Script Compatibility with Older Versions

Another thought, at this point this is just an intellectual excercise to figure out why the two are behaving differently. If you want to ensure that the DateTime column is nominal you can do it after the Open() and that should work.

 

newdt = Open(
	"$SAMPLE_DATA/../Import Data/BigClass.txt",
	columns(
		New Column( "Name", Character, "Nominal" ),
		New Column( "Date",
			Numeric,
			"Continuous",
			Format( "m/d/y", 10 ),
		),
		New Column( "Sex", Character, "Nominal" ),
		New Column( "height", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "weight", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Tab, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 0 ),
		Column Names Start( 1 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

//set modeling type after import newdt:Date << set modeling type( "Nominal" );
-Jeff
LukeFarrell
Level III

Re: JMP14 Script Compatibility with Older Versions

Hi @Jeff_Perkinson, I tried the two methods you sent most recently. 

 

The first method only seemed to work for JMP14 for me and not 13, however the second method(the one this message is a direct reply to) worked on both versions!

 

 

~ Luke :)