Hello JMPers,
My (JMP 14.3.0, W10) intention is to write a function that takes a table (dt) and list of unique Lot Numbers (uids) as input, and construct a table by concatenating a copy of dt for each uid, and filling in the appropriate Lot. No. information for each of those spots. The purpose of this is so I can later do join operations on the table. I am in the early part of the JSL learning curve, and I'm encountering the error as follows:
Unexpected "if". Perhaps there is a missing "," or ")". Trying to parse arguments of function "For".
I presume I have a syntax issue with either my function or my For loop, but the syntax looks the same to me as other code I have that seems to be running correctly. Any/all advice is most welcome!
pop_limits_with_uids = Function( {dt, uids},
For( i = 1, i < N Items( uids ), i++,
Print( "here" );
If( i == 1,
pop_dt = dt << Subset( Output Table( "dt_copy" ), All rows, Selected columns only( 0 ) );
dt_copy = pop_dt;
Print( i );
,
dt_copy = dt << Subset( Output Table( "dt_copy" ), All rows, Selected columns only( 0 ) )
);
Column( dt_copy, "Lot No." )[{1, 2, 3}] = uids[i]; //dt_copy should have 3 rows. Set all 3 Lot No. to latest uid
pop_dt << concatenate( dt_copy, append to first table( 1 ) ); //add to the primary list
);
Close( dt_copy );
);
Regards,
Scott