Check column name if existingHi,
I have a list of column names that I need to check from my table if it exist.
How will I check every columns of the table and prompt an error and stop the program from running if it is not existing?
col_list = {"Col1", "Col2", "Col3", "Col4", "Col5" };
//checks column if exist<BR /> //code continue running
//if column doesn't exist
//code will stop script & error prompt
Data TableOtherScriptingRe: Check column name if existingThe method I use is
col_list = {"col1", "col2", "col3"};
for(i=1,i<=N Items(col_list),i++,
if(try(column(col_list[i])<<GET name=""></GET>Re: Check column name if existinganimals= Open( "C:\Animals.jmp" );
dt_animals = Data Table( "Animals" );
col_list = {"species", "subject", "miles", "season", "name"};
for(i=1,i<=N Items(col_list),i++,
if(try(column(col_list[i])<);
I'm sure I missed something, it's not working for me
Re: Check column name if existingWhat is it that isn't working? I ran your code, and when it reached the column called "name" the code stopped.
The value of the variable "i" ended up as 5, since it stopped processing on the 5th loop. If it had completed processing, the variable "i" would have been 6.
If there was code beyond this piece of code, it would not have been processed.
Re: Check column name if existingThe prompt where it will tell what column is missing