cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

How can use JSL to loop column names into different variables?

Thanks!

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
For( i = 1, i <= N Col( dt ), i++,
	ca = Column( i ) << Get Name;
	Eval( Parse( "c" || Char( i ) || "=" || ca || "" ) );//?
);
a = c1;
b = c2;
1 REPLY 1
jthi
Super User

Re: How can use JSL to loop column names into different variables?

Usually something like this is a very bad idea and its much better idea to use something like list or associative array, but if you really want to do something like this you are missing quotes if you want to get the names

Names Default To Here(1);
Delete Symbols();

dt = Open("$SAMPLE_DATA/Big Class.jmp");
For(i = 1, i <= N Col(dt), i++,
	ca = Column(i) << Get Name;
	Eval(Parse("c" || Char(i) || "= \!"" || ca || "\!""));//?
);
Show Symbols();
-Jarmo

Recommended Articles