Subscribe Bookmark RSS Feed

How to change column data type from Numeric to Character?

ariel

Community Trekker

Joined:

Jan 14, 2015

Hi everyone,

I have a small problem but it seems that no one in the web have a solution for it, not specifically anyway.

I'm trying to change column Data Type from Numeric to Character during JSL run,

Juts to be clear - I'm not trying to change Modeling Type - there are a lot of good examples for that in the web.

I'm trying to change the Data Type - (its seems no one manage to do yet).

thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution

Remove "Data type ( Numeric)", and remove the word SET.  I would also include a variable that points to your dataset.

column("VALUE") << Data Type ( Character);

or better yet:

column(dt, "VALUE") << Data Type ( Character);

where dt points to your data table. 

My original example shortened a bit:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

column(dt, "Height") << Data Type( Character );

Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Solution

This OP asked about changing data type using JSL. In case you're looking to do this interactively you can select the column and then choose Cols -> Column Info...

 

JMPScreenSnapz067.png

Then in the Column Info dialog box change the Data Type.

 

JMPScreenSnapz068.png

 

-Jeff
5 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Go the Scripting Index, select Objects, and then scroll down to Data Table > Column Scripting.  You'll find the method "Data Type" with the following example:

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

Wait( 2 );

dt:Age << Data Type( Character );

dt:Height << Data Type( Numeric, 2 );

ariel

Community Trekker

Joined:

Jan 14, 2015

Hi, thanks but its not working,

I want to change an exiting column -

according to few guide the commend suppose to look like this:

column("VALUE") << Data type( Numeric ) << Set Data Type ( Character)


but still, non is working....

Solution

Remove "Data type ( Numeric)", and remove the word SET.  I would also include a variable that points to your dataset.

column("VALUE") << Data Type ( Character);

or better yet:

column(dt, "VALUE") << Data Type ( Character);

where dt points to your data table. 

My original example shortened a bit:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

column(dt, "Height") << Data Type( Character );

ariel

Community Trekker

Joined:

Jan 14, 2015

Thanks!, It's working!!

Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Solution

This OP asked about changing data type using JSL. In case you're looking to do this interactively you can select the column and then choose Cols -> Column Info...

 

JMPScreenSnapz067.png

Then in the Column Info dialog box change the Data Type.

 

JMPScreenSnapz068.png

 

-Jeff