@PS_Ato, Jim, @txnelson has already provided a solution.
The JMP functions, Sequence() and Count() are very cool functions when working with a data table, since both functions rely on the Row() of the current data table.
There might be times when you want the sequence in just a matrix. One method is the matrix function Direct Product(amat, bmat) . The script below is similar to your original script; it creates seq a vector of repeated values, then assigns them to the new column.
This is provided as an FYI. If you have not used matrices or studied linear algebra, this would not be the first function that might pop into your mind.
Names Default to Here(1);
N_DOE=10;
N_XRF=4;
New Table("Dummy", add rows(N_DOE * N_XRF));
dt=current data table();
seq = Transpose(Direct Product(Index(1,N_DOE),J(1,N_XRF,1)));
dt << new column("Run", "numeric", "ordinal", values(seq));
/* Log output
seq = Transpose(Direct Product(Index(1,N_DOE),J(1,N_XRF,1)));
[1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10]
*/