Choose Language Hide Translation Bar
Highlighted
Level I

## Using variables i JSL

Hi

I'm new to jsl but have a hard time understanding how it deals with variables. In the example below I define an LSL and alpha-value. It seems arbitrary to me, when jmp will use the defined variables and when it won't.

• It has no problem using myLSL in Process Capability
• It wont use myAlpha under Tolerance Interval. Instead, it will use the default value (but does not throw an error saying e.g. that the variable is unknown). If I put in a value directly, it works, but I want to be able to define a variable that I can then reference throughout the script.

Can someone help explain this to a novice jsl user? Or provide a relevant reference. Thank you!

``````myLSL = 2.1; myAlpha = 0.8;

// Distribution and Tolerance Interval
Current Data Table(dt);
Distribution(
Continuous Distribution(
Column("ColumnName"),
Fit Distribution( Normal( Spec Limits( LSL( myLSL ) ) ) ),
Process Capability( LSL( myLSL ), Target( . ), USL( . ) ),
Tolerance Interval(
Alpha( myAlpha ),
Proportion( 0.90 ),
Lower,
Parametric Normal
)
),
);``````

2 REPLIES 2
Highlighted
Staff

## Re: Using variables i JSL

There remains inconsistencies in whether arguments can be variables or they must be literals. The Alpha() argument takes a literal argument. So you must substitute the value in the variable into the expression to make it literal.

``````Names Default to Here( 1 );

// example data set
dt = Open( "\$SAMPLE_DATA/Big Class.jmp" );

myLSL = 50; myAlpha = 0.8;

// Distribution and Tolerance Interval
dist = dt << Distribution(
Continuous Distribution(
Column( :height ),
Fit Normal( Process Capability( LSL( myLSL ), Target( . ), USL( . ) ) )
)
);

Eval(
Substitute(
Expr(
dist << Tolerance Interval(
Alpha( aaa ),
Proportion( 0.9 ),
Lower,
Parametric Normal
)		),
Expr( aaa ), myAlpha
)
);``````
Learn it once, use it forever!
Highlighted
Staff (Retired)

## Re: Using variables i JSL

Craige
Article Labels

There are no labels assigned to this post.