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
AmanS
Level II

Running JSL in background without any windows popping up

Hello,

New JSL user here. I have a nested for loop where I am using a bivariate platform to extract Rsq for each pair and creating a concatenated data table which will eventually hold all Rsq values for all pairs. I am able to get the desired output in the end. However, while the script is running, I get temp tables to pop up and I cannot seem to make them invisible or close (post contenation to another table).

 

Is there a way to flip a switch and turn off any windows to pop up? If not, anyone have a suggestion how to not have the screen keep popping tables while running? Output of the script while running is in the attachment. 

 

Script is below

 

 

For( i = 1, i <= 5, i++,
For (j= 1, j <= 5, j++,
biv = dt << Bivariate(
Y( ParmColumns[i] ),
X( ParmColumns[j] ),
Fit Line( {Line Color( {212, 73, 88} )} ),
Invisible

);
rbiv = biv << Report;
tb = rbiv[Table Box( 1 )];
mcdt = tb << Make Combined Data Table << Show Window( 1 );
if (counter == 0 ,
combineddt = mcdt
);
if (counter > 0 ,
combineddt << Concatenate(
mcdt,
"Append to first table"
);
);
counter ++;
rbiv << Close Window;

mcdt << Invisible;
combineddt << Invisible;
wait(.1);
);

);

// Select and delete all rows that are empty
combineddt << Select Where(:"Column 1" != "RSquare") << Delete Rows;
combineddt << Select Where(:X == :Y) << Delete Rows;

//save stacked data table
combineddt << Save (Output_File );


// Close data table and do not save JMP tables. CSV files are already saved.
Close All( Data Tables, NoSave );

Screen Shot 2020-07-02 at 4.51.53 PM.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
gzmorgan0
Super User (Alumni)

Re: Running JSL in background without any windows popping up

@AmanS ,

You should look up "invisible"  for report wndows and invisible vs private for data tables.

 

Names Default To Here( 1 );
flag=random Integer(0,1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
if(flag==1,
         obj = dt << Bivariate( Y( :Weight ), X( :Height ), Invisible ),
       //else
		obj = dt << Bivariate( Y( :Weight ), X( :Height ) )
		
 ); //end if

View solution in original post

Re: Running JSL in background without any windows popping up

You can learn much from @gzmorgan0's solution. It is provides a general framework. In this specific case, though, I will use JMP interactively to get what I want. No explicit iteration is required as JMP almost calculates the desired result for you. Just one extra step at the end.

 

Actually, I wrote a script to do it but the comments should provide the path to the result that you want.

 

Names Default to Here( 1 );

// open example with several continuous numeric variables
dt = Open( "$SAMPLE_DATA/Fitness.jmp" ) ;

// obtain names of such variables
cols = dt << Get Column Names( Continuous );

// convert the names to references
cols = dt << Get Column Reference( cols );

// use the references to launch platform with list of correlations
mult = dt << Multivariate( Y( Eval( cols ) ), Pairwise Correlations );

// obtain new data table with correlations
dt = Report( mult )["Pairwise Correlations"][TableBox(1)] << Make Into Data Table;

// convert correlations into linear coefficient of determination
dt << New Column( "R Square", Numeric, Continuous,
	Values( (dt:Correlation << Get As Matrix)^2 )
);

View solution in original post

5 REPLIES 5
gzmorgan0
Super User (Alumni)

Re: Running JSL in background without any windows popping up

@AmanS ,

You should look up "invisible"  for report wndows and invisible vs private for data tables.

 

Names Default To Here( 1 );
flag=random Integer(0,1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
if(flag==1,
         obj = dt << Bivariate( Y( :Weight ), X( :Height ), Invisible ),
       //else
		obj = dt << Bivariate( Y( :Weight ), X( :Height ) )
		
 ); //end if
AmanS
Level II

Re: Running JSL in background without any windows popping up

Thanks @gzmorgan0 

 

Appreciate you taking the time to respond to this query :)

Re: Running JSL in background without any windows popping up

You can learn much from @gzmorgan0's solution. It is provides a general framework. In this specific case, though, I will use JMP interactively to get what I want. No explicit iteration is required as JMP almost calculates the desired result for you. Just one extra step at the end.

 

Actually, I wrote a script to do it but the comments should provide the path to the result that you want.

 

Names Default to Here( 1 );

// open example with several continuous numeric variables
dt = Open( "$SAMPLE_DATA/Fitness.jmp" ) ;

// obtain names of such variables
cols = dt << Get Column Names( Continuous );

// convert the names to references
cols = dt << Get Column Reference( cols );

// use the references to launch platform with list of correlations
mult = dt << Multivariate( Y( Eval( cols ) ), Pairwise Correlations );

// obtain new data table with correlations
dt = Report( mult )["Pairwise Correlations"][TableBox(1)] << Make Into Data Table;

// convert correlations into linear coefficient of determination
dt << New Column( "R Square", Numeric, Continuous,
	Values( (dt:Correlation << Get As Matrix)^2 )
);
AmanS
Level II

Re: Running JSL in background without any windows popping up

Thanks @Mark_Bailey . I like how streamlined the code is using the multivariate feature instead of what I was trying to do with a complicated nested for loop. :( Much to learn! :)

Craige_Hales
Super User

Re: Running JSL in background without any windows popping up

Removing the wait(...) may be sufficient. That gives the OS time to show the window. Wait is usually not needed, or there is an alternative that doesn't need it, like <<runformulas. Sometimes you do need the window to show/update though.

 

edit:

instead of

mcdt << Invisible; // does not work this way

which @gzmorgan0  showed the right way to use, you probably want to close the tables as soon as they are no longer needed. Change it to 

close(mcdt,"nosave");

I'd still leave out the wait(...) .

Craige