Let's imagine we work with the JMP file "abrasion.jmp", and we would want to like to apply something like the functionality of SAS' %let macro variables.
In SAS I could execute WHERE clauses like ...
(1) "where ABRASION is (&MY_ABRASION.);"
... after having specified the macro vars before like: %let MY_ABRASION=133 ; (e.g. 1st usage)
%let MY_ABRASION=145 ; (e.g. 2nd usage)
(2) "where DATE eq (&MY_DATE.);"
...after having specified the macro vars before like: %let MY_DATE="29Feb1995"d; (e.g. 1st usage)
%let MY_DATE="2May1995"d ; (e.g. 2nd usage)
(3) or even as combination like "where DATE eq (&MY_DATE.) and ABRASION is (&MY_ABRASION.)"; ...
How could you do that in JMP?
Please provide practical examples.
Thanks a lot,
Go to Solution
Below are a couple of examples where JMP variables are used with JMP data table columns to achieve similar functionality as in your SAS MACRO examples.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
my_gender = "M";
Bivariate( Y( :height ), X( :weight ), Where( :sex == my_gender ) );
dtAirline = Open( "$SAMPLE_DATA/Aircraft Incidents.jmp" );
my_date = Informat( "01/23/2001", Date MDY( 10 ) );
dtAirline << select where( :Event Date <= my_date );
dtAirlineSubset = dtAirline << subset( selected columns( 0 ), selected rows( 1 ) );
dtAirlineSubset << run script( "Graph Builder Map" );
The best documentation for learning about the JMP Scripting Language is found in the Scripting Guide
I strongly suggest that you take the time to read through it
View solution in original post
To show the beauty of this feature, you can also use the actual value in a title such as we know from SAS, i.e., "&string."
Bivariate( Y( :height ), X( :weight ), Where( :sex == my_gender ), Title("Selection: " || my_gender ));
So, this allows to develop an application quite generically :)
There are no labels assigned to this post.