cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Changing data type from character to continuous with JSL

I have a script that gets back the time as character. The format is correct but I want  to automate this change of data type automatically.

tsformat.jpg

How to do so in JSL scripting?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Changing data type from character to continuous with JSL

From the screenshot you are displaying, it appears that whatever methodology you are using to generate the TS_UTC column, that it is being generated as a character column.  The following JSL will convert from your character column to a numeric, continuous column, with your desired display format.

names default to here(1);
dt=current data table();
dt:TS_UTC<<data type(numeric)<<modeling type(continuous)<<format("yyyy-mm-ddThh:mm:ss");
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Changing data type from character to continuous with JSL

From the screenshot you are displaying, it appears that whatever methodology you are using to generate the TS_UTC column, that it is being generated as a character column.  The following JSL will convert from your character column to a numeric, continuous column, with your desired display format.

names default to here(1);
dt=current data table();
dt:TS_UTC<<data type(numeric)<<modeling type(continuous)<<format("yyyy-mm-ddThh:mm:ss");
Jim

Recommended Articles