1. A matrix can only contain numeric values. Therefore, the matrix z needs to be specified as a List, not as a Matrix
2. I do not know what "cust" is.
3. Is this a column formula, or open JSL code?
4. Loc returns a matrix of the positions where the testing value is found in the List. Therefore, you need to determine if more than 0 rows were returned to determine if a match has been found.
Below are a couple of script examples that might help you out
Names Default To Here( 1 );
dt = Current Data Table();
// As a formula in a new column
dt << New Column( "is present",
formula(
z = {"customer1", "customer2", "customer3"};
If( N Rows( Loc( z, :Name( "Ship-To Customer" ) ) > 0 ),
1,
0
);
)
);
// In open JSL
z = {"customer1", "customer2", "customer3"};
For( i = 1, i <= N Rows( dt ), i++,
If( N Rows( Loc( z, :Name( "Ship-To Customer" )[i] ) ) > 0,
1,
0
);
);
Jim