BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
jimNQBkelly
Community Trekker

How do I run JMP scripts on a schedule

I have a series of JMP analyses that I want to run on a production basis and save the output to interactive HTML files.

I have figured out how to put the analyses into script files and dashboards, but I'm not clear how to set things up so that the computer will automatically run the scripts on a daily or hourly basis.  Is this possible?

 

Jim

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
ih
ih
Community Trekker

Re: How do I run JMP scripts on a schedule

I am not sure if you are on Windows or a Mac, but in windows I use the Task Scheduler (search for it using the start button) to run batch file (choose it as the 'Application to Run').  The batch file calls JMP and tells it what script to open.  Make sure to put exit( nosave ) at the end of the jsl script.

 

Batch File:

"C:\Program Files\SAS\JMPPRO\13\jmp.exe" "C:/pathto/TaskSchedulerGraphs.jsl"

 

JSL File:

Names default to here( 1 );

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

height = { 800, 1080 };

t = Today();

pad = function( {v} , if( v < 10, "0", "" ) || char(v) );

for( i = 1, i <= n items( height ), i++,
	win = New Window( "graph holder",
		dt << Graph Builder(
			Size( floor( height[i] * 16 / 9 ), height[i] ),
			Show Control Panel( 0 ),
			Variables(
				X( :Sepal length ),
				Y( :Sepal width ),
				Group X( :Species ),
				Group Y( :Petal width ),
				Color( :Petal length )
			),
			Elements( Points( X, Y, Legend( 4 ) ) )
		);
	);
	pic = ( win << Find( ListBox(2) ) ) << get picture;
	ImageFilename = "iris_" || pad( Hour( t ) ) || pad( Minute( t ) ) ||
		pad( Second( t ) ) || "_" || char( height[i] ) || ".png";
	pic << Save Image( "$Desktop/" || ImageFilename );
	win << Close Window;
);

exit(nosave);

View solution in original post

3 REPLIES 3
jimNQBkelly
Community Trekker

Re: How do I assign a start date?

The title I want for this post is: "How do I run JMP scripts on a schedule in other words on a production basis"

0 Kudos
ih
ih
Community Trekker

Re: How do I run JMP scripts on a schedule

I am not sure if you are on Windows or a Mac, but in windows I use the Task Scheduler (search for it using the start button) to run batch file (choose it as the 'Application to Run').  The batch file calls JMP and tells it what script to open.  Make sure to put exit( nosave ) at the end of the jsl script.

 

Batch File:

"C:\Program Files\SAS\JMPPRO\13\jmp.exe" "C:/pathto/TaskSchedulerGraphs.jsl"

 

JSL File:

Names default to here( 1 );

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

height = { 800, 1080 };

t = Today();

pad = function( {v} , if( v < 10, "0", "" ) || char(v) );

for( i = 1, i <= n items( height ), i++,
	win = New Window( "graph holder",
		dt << Graph Builder(
			Size( floor( height[i] * 16 / 9 ), height[i] ),
			Show Control Panel( 0 ),
			Variables(
				X( :Sepal length ),
				Y( :Sepal width ),
				Group X( :Species ),
				Group Y( :Petal width ),
				Color( :Petal length )
			),
			Elements( Points( X, Y, Legend( 4 ) ) )
		);
	);
	pic = ( win << Find( ListBox(2) ) ) << get picture;
	ImageFilename = "iris_" || pad( Hour( t ) ) || pad( Minute( t ) ) ||
		pad( Second( t ) ) || "_" || char( height[i] ) || ".png";
	pic << Save Image( "$Desktop/" || ImageFilename );
	win << Close Window;
);

exit(nosave);

View solution in original post

jimNQBkelly
Community Trekker

Re: How do I run JMP scripts on a schedule

I'm using a windows machine.  Your answer works fine, albeit, I needed to specify that JMP would close without prompting for remembering open files.

Thank you so much

0 Kudos