cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

Scripting Data Type- date properties with non-conforming format

Roddy
Level I

I'm struggling with changing this column property to a numerical continuous date. I know it's not a standard format, since it is in yymmdd and not yyyymmdd or m/d/y. Here is one of the many variations of the JSL I have tried to use that doesn't work. Is there another way?

 

Data Table("XYZData"):Date1 of MFG << Set Data Type(Numeric, Format( "y/m/d", 10 ), Input Format( "yymmdd" );

 

Roddy_0-1741373601540.png

 

2 REPLIES 2
mmarchandFSLR
Level IV


Re: Scripting Data Type- date properties with non-conforming format

Input Format( "Format Pattern", "<YY><MM><DD>" )
jthi
Super User


Re: Scripting Data Type- date properties with non-conforming format

Format Pattern is usually the best option to format dates (and times) in JMP (in my opinion). You would do this most of the time interactively in JMP (sometimes this can be a bit annoying to get working or understand how it works though). 

Starting point character nominal

jthi_4-1741418961930.png

Change to Numeric Continuous and change format (do not press Apply or OK yet)

jthi_5-1741418992845.png

Click set format pattern, set the format provided by @mmarchandFSLR 

jthi_6-1741419027678.png

And then click OK (or apply first).

 

Next right click on the formatted column and select Copy Columns

New Column("Column 3",
	Numeric,
	"Continuous",
	Format("yyyy-mm-dd", 12),
	Input Format("Format Pattern", "<YY><MM><DD>"),
	Set Selected
)

Or check enhanced log, this is better option in this case as you are modifying existing column

jthi_7-1741419097812.png

// Change column info: Column 3
Data Table("Untitled"):Column 3 << Set Data Type(
	Numeric,
	Format("Format Pattern", "<YY><MM><DD>", 6),
	Input Format("Format Pattern", "<YY><MM><DD>"),
	Format("yyyy-mm-dd", 12)
) << Set Modeling Type("Continuous");
-Jarmo