JSL: How to change a column to a 1-byte integerI'm working with large files and am trying to be more thrifty when it comes to memory. I want to change the data type for some columns to "1-byte integer" using JSL but can't figure it out.
I have set my Table preferences to "Allow short numeric data format," and I can change a column's data type by hand, but I need to do it with JSL. If I change the data type by hand and then copy and paste the column into a script I see the data type for a 1-byte integer appears to be "Numeric(1)" . Maybe that is a clue.
Here are some things I've tried:
dt = open("$sample_data/big class.jmp");
dt:age << Data Type(1-byte integer); //error "Agument to Type..."
dt:age << Data Type("1-byte integer"); //error "Agument to Type..."
dt:age << Data Type(Character); //this works, changes to Character
dt:age << Data Type(Numeric); //this works, changes to Numeric
dt:age << Data Type(Numeric(1)); //no error, but data type stays NumericIt's probably something simple, but I've found no solution in the JMP Help or Community so far. Any help would be appreciated. (I'm on JMP 16.1.)
Data TableScriptingRe: JSL: How to change a column to a 1-byte integerSearch Scripting Index with "1-byte":

Seems to be working:

Re: JSL: How to change a column to a 1-byte integerThanks! I was hoping to find a way to tell JMP when I create the column that it's only going to be ones and zeros and therefore 1-byte integer is plenty.
It seems strange to me that I can force a column to be a 1-, 2-, or 4-byte integer using the column properties menus, but I can't do it with scripting. I wonder if this has to do with the fact that there is a preference option that allows these data types and JSL is not "smart" enough to know whether this is enabled but the GUI is.

Compressing is a solution, but I'd still be interested if anyone knows how to set modeling type before populating the column.
Re: JSL: How to change a column to a 1-byte integerHere is an example to make a new variable as a data column with a short word length for signed integers using a single byte.
Names Default to Here( 1 );
// open target data table
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// set JMP preferences to accept short numeric words
Set Preference( Allow short numeric data format( 1 ) );
// create a new column using shortened numeric data type
shorty = dt << New Column( "Short Age", Numeric( 1 ), Continuous,
Values( :age << Get As Matrix )
);
// your done. maybe set preference back to default
Set Preference( Allow short numeric data format( 0 ) );