To add a new column to a data table, send a New Column message to a data table reference. The first argument, the column’s name, is required. Either enclose the name in quotation marks or specify an expression evaluating to the name.
dt = Open( "MyData.jmp" );
dt << New Column( "wafer" );
a = "wafer";
dt << New Column( a );
dt << New Column( "wafer", Numeric, "Continuous", Format( "Best", 5 ) );
dt << New Column( "Last Name", Character );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dt << New Column( "Ratio", Numeric, "Continuous", Formula( :height/:weight ) );
dt << New Column( "myMarkers",
	Row State,
	Set Formula( Marker State( age - 12 ) )
);
myCol = dt << New Column( "Birth Date" );
To fill the column with data, use Values or its equivalent, Set Values. Include the value for each cell in a list.
dt = New Table( "My Data");
dt << New Column( "Last Name", Character, Values( {"Smith", "Jones", "Anderson"} ) );
The column can also be filled with numeric values. The following example adds a new column called Row Number to a new data table. The function N Row returns the number of rows in the table, and numeric values populate all of the rows in the column, beginning with 1.
dt = New Table( "My Data");
dt << New Column( "Row Number",
	Numeric,
	Values( 1 :: N Row() ),
	Format( "Best", 5 )
);
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
dt << New Column( "Random", Numeric, Formula( Random Uniform() ) );
dt << New Column( "Number" );
:Number << Set Each Value( 5 );
New Column() can also be used as a built-in function, in other words, without the << (Send) command applied to the data table reference. When used in this way, the column is added to the current data table.
dt << New Column( "Address" ); // command is sent to the data table reference
dt << New Column( "Address" ); // column is added to the current data table