Scripting Guide > Extending JMP > Work with SAS > Create SAS DATA Step Code for Formula Columns
发布日期: 04/13/2021

Create SAS DATA Step Code for Formula Columns

Sending Get SAS Data Step for Formula Columns to a data table includes column formulas in the SAS data step code. Here is an example that outputs the formula for the Ratio column:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Ratio", Formula( :height / :weight ));
dt << Get SAS Data Step for Formula Columns;

This script output the following code to the log:

/*%PRODUCER: JMP - DataTable Formulas */

/*%TARGET: Ratio */

/*%INPUT: height */

/*%INPUT: weight */

/*%OUTPUT: Ratio */

/* Code to score Ratio */

Ratio =height/weight

drop ;

To get formulas for all columns, omit the column names as shown here:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Get SAS Data Step for Formula Columns;

You can also include column formulas in scoring code for SAS Model Manager. Send Get MM SAS Data Step for Formula Columns to the data table.

dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
dt << Get MM SAS Data Step for Formula Columns;

The results of this script are also shown in the log.

As with Get SAS Data Step for Formula Columns, specifying column names is optional.

需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).