Unable to Convert Character Column to Continuous Date Format Using JSLHello,
I have an input table with a column TEST_START_DATETIME that JMP initially recognizes as a Character/Nominal Data/Modeling Type as shown below.

I can set this column as a continuous date/time format type using the Column Info dialog.

Note the text is shifted to the right, indicating it's a cell.

However, when I try to do this in JSL I get an empty column. It looks like it converted the column to numeric type before applying the format type, causing it to get deleted.
dt = Current Data Table();
dt << Begin Data Update;
dt:TEST_START_DATETIME << Data Type("Numeric");
dt:TEST_START_DATETIME << Modeling Type("Continuous");
dt:TEST_START_DATETIME << Input Format("Format Pattern", "<YYYY>_<MM>_<DL><DD>-<HH24>_<MM>_<SS>");
dt:TEST_START_DATETIME << Format("Format Pattern", "<YYYY>_<MM>_</MM></YYYY></SS></MM></HH24></DD><DD>-<HH24>_<MM>_<SS>");
dt << End Data Update;
<P>What could I be doing wrong?</P></SS><LINGO-LABS id="lingo-labs-921437" slang="en-US" mode="CREATE"><LINGO-LABEL>Automation and Scripting</LINGO-LABEL></LINGO-LABS></MM></HH24></DD></DL></MM></YYYY>Re: Unable to Convert Character Column to Continuous Date Format Using JSLYou are doing << Data Type("Numeric") first -> it will be converted to number too early. Do it manually in JMP, look at the log and copy the script.
// Change column info: Column 1
Data Table("Untitled"):Column 1 << Set Data Type(
Numeric,
Format("Format Pattern", "<DL><DD><-><MM><-><YYYY> <HH24><::><MM><::><SS>", 19, 0),
Input Format("Format Pattern", "</SS></MM></HH24></YYYY></MM></DD><DD><-><MM><-><YYYY> <HH24><::><MM><::><SS>", 0)
) << Set Modeling Type("Continuous");
<P>Scripting Index also has an example on how to change data type while applying formatting</P>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1766813326876.png" style="width: 999px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="jthi_0-1766813326876.png" style="width: 999px;"><span class="lia-inline-image-display-wrapper" image-alt="jthi_0-1766813326876.png" style="width: 999px;"><img src="https://us.v-cdn.net/6038925/uploads/images/89734iEC89C684D92EC534/jthi_0-1766813326876.png" role="button" title="jthi_0-1766813326876.png" alt="jthi_0-1766813326876.png" /></span></SPAN></SPAN></P>
<P> </P></SS></MM></HH24></YYYY></MM></DD></DL>Re: Unable to Convert Character Column to Continuous Date Format Using JSLThanks! I looked at the output log, copied the same script and it now works when run as a standalone script. I didn't know that the log window could be used to see commands invoked through GUI in real time.
dt = Current Data Table();
dt:TEST_START_DATETIME << Set Data Type(
Numeric,
Format( "Format Pattern", "<YYYY>_<MM>_<DL><DD>-<HH24>_<MM>_<SS>", 19, 0 ),
Input Format( "Format Pattern", "<YYYY>_<MM>_</MM></YYYY></SS></MM></HH24></DD><DD>-<HH24>_<MM>_<SS>", 0 )
) << Set Modeling Type( "Continuous" );</SS></MM></HH24></DD></DL></MM></YYYY>