BookmarkSubscribe
Choose Language Hide Translation Bar
Newbie2Jumpie
Contributor

How do I macro variables with JMP, e.g. like SAS macro variables (scripting, JSL)

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,

Newbie (still)

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: How do I macro variables with JMP, e.g. like SAS macro variables (scripting, JSL)

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

     Help==>Books==>Scripting Guide

I strongly suggest that you take the time to read through it

Jim
1 REPLY 1
Highlighted
txnelson
Super User

Re: How do I macro variables with JMP, e.g. like SAS macro variables (scripting, JSL)

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

     Help==>Books==>Scripting Guide

I strongly suggest that you take the time to read through it

Jim