cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. ET on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-237194%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E4%BD%BF%E7%94%A8%20JSL%20%E5%B0%87%E6%95%B8%E6%93%9A%E9%A1%9E%E5%9E%8B%E5%BE%9E%E5%AD%97%E7%AC%A6%E6%9B%B4%E6%94%B9%E7%82%BA%E9%80%A3%E7%BA%8C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-237194%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E6%9C%89%E4%B8%80%E5%80%8B%E8%85%B3%E6%9C%AC%E5%8F%AF%E4%BB%A5%E6%81%A2%E5%BE%A9%E8%A7%92%E8%89%B2%E7%9A%84%E6%99%82%E9%96%93%E3%80%82%20%E6%A0%BC%E5%BC%8F%E6%AD%A3%E7%A2%BA%EF%BC%8C%E4%BD%86%E6%88%91%E6%83%B3%E8%87%AA%E5%8B%95%E8%87%AA%E5%8B%95%E6%9B%B4%E6%94%B9%E6%95%B8%E6%93%9A%E9%A1%9E%E5%9E%8B%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22tsformat.jpg%22%20style%3D%22width%3A%20781px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22tsformat.jpg%22%20style%3D%22width%3A%20781px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22tsformat.jpg%22%20style%3D%22width%3A%20781px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F20516i2EDEBE0BD6000710%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22tsformat.jpg%22%20alt%3D%22tsformat.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E5%A6%82%E4%BD%95%E5%9C%A8%20JSL%20%E8%85%B3%E6%9C%AC%E4%B8%AD%E9%80%99%E6%A8%A3%E5%81%9A%EF%BC%9F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-237216%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%BD%BF%E7%94%A8%20JSL%20%E5%B0%87%E6%95%B8%E6%93%9A%E9%A1%9E%E5%9E%8B%E5%BE%9E%E5%AD%97%E7%AC%A6%E6%9B%B4%E6%94%B9%E7%82%BA%E9%80%A3%E7%BA%8C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-237216%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%BE%9E%E6%82%A8%E9%A1%AF%E7%A4%BA%E7%9A%84%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9C%96%E7%9C%8B%E4%BE%86%EF%BC%8C%E7%84%A1%E8%AB%96%E6%82%A8%E4%BD%BF%E7%94%A8%E4%BB%80%E9%BA%BC%E6%96%B9%E6%B3%95%E7%94%9F%E6%88%90%20TS_UTC%20%E5%88%97%EF%BC%8C%E5%AE%83%E9%83%BD%E6%98%AF%E4%BD%9C%E7%82%BA%E5%AD%97%E7%AC%A6%E5%88%97%E7%94%9F%E6%88%90%E7%9A%84%E3%80%82%E4%BB%A5%E4%B8%8B%20JSL%20%E5%B0%87%E5%BE%9E%E6%82%A8%E7%9A%84%E5%AD%97%E7%AC%A6%E5%88%97%E8%BD%89%E6%8F%9B%E7%82%BA%E5%85%B7%E6%9C%89%E6%82%A8%E6%89%80%E9%9C%80%E9%A1%AF%E7%A4%BA%E6%A0%BC%E5%BC%8F%E7%9A%84%E6%95%B8%E5%AD%97%E9%80%A3%E7%BA%8C%E5%88%97%E3%80%82%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Enames%20default%20to%20here(1)%3B%0Adt%3Dcurrent%20data%20table()%3B%0Adt%3ATS_UTC%26lt%3B%3CDATA%20type%3D%22%22%3E%3C%2FDATA%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
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