- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to change column data type from Numeric to Character?
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,
Just 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 - (it seems no one manage to do yet).
thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
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...
Then in the Column Info dialog box change the Data Type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
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....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
Thanks!, It's working!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to change column data type from Numeric to Character?
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...
Then in the Column Info dialog box change the Data Type.