Hi,
I am trying to execute below script, when I try to parse string that has @ I get below error (see log below), please advise.
dt= data table ("RECIPE");
col={"COL_RECIPE@112345@X*HELLO", "COL_RECIPE@78902@X*GET"};
If( Contains( col[1], "COL_RECIPE@112345@X*HELLO" ),
dt<< New Column ("NEW_RECIPE",
Character,
);
text="Column(\!"NEW_RECIPE\!")<< Formula(:" || col[1] || ");";
Eval(Parse(text));
);
error log:
Unexpected "@". Perhaps there is a missing "," or ")".
Trying to parse arguments of function "Formula".
Line 1 Column 43: ...E")<< Formula(:COL_RECIPE►@112345@X*HELLO);...
JMP is getting confused because the column name contains "@" and "*". This code will work:
dt = Open( "$sample_data\Big Class.jmp" );
col = {"COL_RECIPE@112345@X*HELLO", "COL_RECIPE@78902@X*GET"};
If( Contains( col[1], "COL_RECIPE@112345@X*HELLO" ),
dt << New Column( "NEW_RECIPE", Character, );
text = evalinsert("\[Column(dt, "NEW_RECIPE")<< Formula(:name("^col[1]^"));]\");
Eval( Parse( text ) );
);
JMP is getting confused because the column name contains "@" and "*". This code will work:
dt = Open( "$sample_data\Big Class.jmp" );
col = {"COL_RECIPE@112345@X*HELLO", "COL_RECIPE@78902@X*GET"};
If( Contains( col[1], "COL_RECIPE@112345@X*HELLO" ),
dt << New Column( "NEW_RECIPE", Character, );
text = evalinsert("\[Column(dt, "NEW_RECIPE")<< Formula(:name("^col[1]^"));]\");
Eval( Parse( text ) );
);