cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Resheffink1
Level I

If statement not working in jsl

Hi all.

 

Can you please check what is the problem with my if statement? I want to run several jsl commands in case the condition is true (in my case, that the spec file name is as written in the code) but it does not work.

Everything else is working fine, just the if statement is not.

 

My JMP version is 18

 

 

dt = Current Data Table();
dt << Select Columns( :PARAMETER );
dt << Text To Columns( delimiter( "_" ) );
dt << delete columns( :PARAMETER 1 );
If( :SPECFILE == "MS-SMLD",
	:PARAMETER 2 << set name( "Column_name1" );
	:PARAMETER 3 << set name( "Column_name2" );
	:PARAMETER 4 << set name( "Column_name3" );
	:PARAMETER 5 << set name( "Column_name4" );
	:PARAMETER 6 << set name( "Column_name5" ) ;
	,
	If( :SPECFILE == "SMLA", Formula(
		dt << delete columns( :PARAMETER 5 );
		:PARAMETER 2 << set name( "Column_name1" );
		:PARAMETER 3 << set name( "Column_name2" );
		:PARAMETER 4 << set name( "Column_name3" );
		 )
	)
);

Thanks,

Reshef

4 REPLIES 4
jthi
Super User

Re: If statement not working in jsl

Might be enough if you changed :SPECFILE to SPECFILE (:SPECFILE would (usually) refer to a column).

-Jarmo
Resheffink1
Level I

Re: If statement not working in jsl

Hi.

 

Thanks! but the "SPECFILE" is indeed a column in my jmp table.

Anyway, I tried it and it does not work.

 

Maybe its what separate the jsl commands in my IF statement?

Or, maybe its impossible to run several jsl commands in one IF statement?

 

 

Thanks,

Reshef

jthi
Super User

Re: If statement not working in jsl

Then you have to define the Row (Row() = 1; for example) or loop over the rows in your table using For Each Row. The "default" row in JMP is 0 which isn't valid row

-Jarmo
txnelson
Super User

Re: If statement not working in jsl

If what you are trying to do, is to look at row 1's value in column "SPECFILE" and then make decisions based on it, the JSL below will be what you want

Names Default To Here( 1 );
dt = Current Data Table();
dt << Select Columns( :PARAMETER );
dt << Text To Columns( delimiter( "_" ) );
dt << delete columns( :PARAMETER 1 );
If(
	:SPECFILE[1] == "MS-SMLD",
		:PARAMETER 2 << set name( "Column_name1" );
		:PARAMETER 3 << set name( "Column_name2" );
		:PARAMETER 4 << set name( "Column_name3" );
		:PARAMETER 5 << set name( "Column_name4" );
		:PARAMETER 6 << set name( "Column_name5" );,
	:SPECFILE[1] == "SMLA",
		dt << delete columns( :PARAMETER 5 );
		:PARAMETER 2 << set name( "Column_name1" );
		:PARAMETER 3 << set name( "Column_name2" );
		:PARAMETER 4 << set name( "Column_name3" );
);
Jim

Recommended Articles