Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
ts2
ts2
Level III

What does the Number after New Column Character(19) mean?

JMP 12.2

I would like to understand the meaning of this number and most importantly how to remove/modify it . I would like to avoid duplicating the columns due to these being very large tables that need to be manipulated quickly.

 

The number "19" shown after the word "Character" below (the number can be different, i just chose 19 as an example):

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1", Character( 19 ), "Nominal", Set Values( {"Hello World"} ) )
)

Once the table is generated, how would I get rid of the "( 19 )" the quickest way possible?

 

I tried:

:Column1 << Data type( Character );
:Column1 << Data type( Character() );
:Column1 << Data type( Character(0) );

I can see it using GetScript(), I cannot see it using ShowProperties();

 

You may say it is benign, and usually I do not worry about this number but I have found one case where a Join becomes erroneous with the number in place (or maybe this number is supposed to influence Joins).

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: What does the Number after New Column Character(19) mean?

Your question confused me.  I have been using JMP since the 1990s and do not remember ever coming across "Character(x)".  So I did some investigation.  The majority of the references to using the this notation are from providing column width information to the reading in of .txt files, or in OLE applications.  There is one reference in the Scripting Guide for "Add Multiple Columns".  However, in looking at the syntax in the Scripting Index for "Add Multiple Columns", it refers to using an element called "fieldwidth(number)", not a (number) after the data type specification of Character.  From what I can tell, it just sets up a minimum width of the column being created.  Since JMP character values/columns are dynamic and can be from 0 to over a billion characters in length, I would suggest that in your coding that you never use the width specification after the defining of a new column being of data type Character.

Now, how to get rid of the minimum width.

I found, that if you assign a character value of a significant length, over the specified width, that JMP removed the width specification.  

So given your example

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1", Character( 19 ), "Nominal", Set Values( {"Hello World"} ) )
);

Retrieving the data table script returns

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1",
		Character( 19 ),
		"Nominal",
		Set Values( {"Hello World"} )
	)
)

If you run the following JSL that gets the value of the first row in the data table, and assigns a lengthy value to the first row, and then finally replaced the original value back, using this code

holdValue = :Column1[1];
:Column1[1] = repeat("a",500);
:column1[1] = holdValue;

The retrieved table script is

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1", Character, "Nominal", Set Values( {"Hello World"} ) )
)

The width reference has been removed.

This was all tested using JMP 12.2

This is the method I came up with, to eliminate the character width issue.  Some other Community Member may have a better way.  I hope they do!

Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: What does the Number after New Column Character(19) mean?

Your question confused me.  I have been using JMP since the 1990s and do not remember ever coming across "Character(x)".  So I did some investigation.  The majority of the references to using the this notation are from providing column width information to the reading in of .txt files, or in OLE applications.  There is one reference in the Scripting Guide for "Add Multiple Columns".  However, in looking at the syntax in the Scripting Index for "Add Multiple Columns", it refers to using an element called "fieldwidth(number)", not a (number) after the data type specification of Character.  From what I can tell, it just sets up a minimum width of the column being created.  Since JMP character values/columns are dynamic and can be from 0 to over a billion characters in length, I would suggest that in your coding that you never use the width specification after the defining of a new column being of data type Character.

Now, how to get rid of the minimum width.

I found, that if you assign a character value of a significant length, over the specified width, that JMP removed the width specification.  

So given your example

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1", Character( 19 ), "Nominal", Set Values( {"Hello World"} ) )
);

Retrieving the data table script returns

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1",
		Character( 19 ),
		"Nominal",
		Set Values( {"Hello World"} )
	)
)

If you run the following JSL that gets the value of the first row in the data table, and assigns a lengthy value to the first row, and then finally replaced the original value back, using this code

holdValue = :Column1[1];
:Column1[1] = repeat("a",500);
:column1[1] = holdValue;

The retrieved table script is

New Table( "Untitled",
	Add Rows( 1 ),
	New Column( "Column1", Character, "Nominal", Set Values( {"Hello World"} ) )
)

The width reference has been removed.

This was all tested using JMP 12.2

This is the method I came up with, to eliminate the character width issue.  Some other Community Member may have a better way.  I hope they do!

Jim

View solution in original post

Highlighted
ts2
ts2
Level III

Re: What does the Number after New Column Character(19) mean?

Yeah I had a hard time trying to find documentation of what the number means. I sure don't put it there... seems to be auto generated.

Your method seems to work but I wonder if there is a more elegant way to modify or remove it.

 

Thanks a bunch for the help!