<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JSL: How to change a column to a 1-byte integer in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/451294#M69816</link>
    <description>&lt;P&gt;Search Scripting Index with "1-byte":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1642107521176.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38980i6A94213310AA04C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1642107521176.png" alt="jthi_1-1642107521176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems to be working:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1642107515862.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38979i1AC4D42DCC83B2AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1642107515862.png" alt="jthi_0-1642107515862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jan 2022 20:59:27 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-01-13T20:59:27Z</dc:date>
    <item>
      <title>JSL: How to change a column to a 1-byte integer</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/451240#M69814</link>
      <description>&lt;P&gt;I'm working with large files and am trying to be more thrifty when it comes to memory. I want to change the data type for some columns to "1-byte integer" using JSL but can't figure it out.&lt;/P&gt;&lt;P&gt;I have set my Table preferences to "Allow short numeric data format," and I can change a column's data type by hand, but I need to do it with JSL.&amp;nbsp; If I change the data type by hand and then copy and paste the column into a script I see the data type for a 1-byte integer appears to be "Numeric(1)" . Maybe that is a clue.&lt;/P&gt;&lt;P&gt;Here are some things I've tried:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = open("$sample_data/big class.jmp");
dt:age &amp;lt;&amp;lt; Data Type(1-byte integer);	//error "Agument to Type..."
dt:age &amp;lt;&amp;lt; Data Type("1-byte integer");	//error "Agument to Type..."
dt:age &amp;lt;&amp;lt; Data Type(Character);			//this works, changes to Character
dt:age &amp;lt;&amp;lt; Data Type(Numeric);			//this works, changes to Numeric
dt:age &amp;lt;&amp;lt; Data Type(Numeric(1));		//no error, but data type stays Numeric&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It's probably something simple, but I've found no solution in the JMP Help or Community so far. Any help would be appreciated. (I'm on JMP 16.1.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:42:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/451240#M69814</guid>
      <dc:creator>TomF</dc:creator>
      <dc:date>2023-06-10T23:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: How to change a column to a 1-byte integer</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/451294#M69816</link>
      <description>&lt;P&gt;Search Scripting Index with "1-byte":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1642107521176.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38980i6A94213310AA04C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1642107521176.png" alt="jthi_1-1642107521176.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems to be working:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1642107515862.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38979i1AC4D42DCC83B2AF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1642107515862.png" alt="jthi_0-1642107515862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 20:59:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/451294#M69816</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-01-13T20:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: How to change a column to a 1-byte integer</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/452384#M69911</link>
      <description>&lt;P&gt;Thanks! I was hoping to find a way to tell JMP when I create the column that it's only going to be ones and zeros and therefore 1-byte integer is plenty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems strange to me that I can force a column to be a 1-, 2-, or 4-byte integer using the column properties menus, but I can't do it with scripting.&amp;nbsp; I wonder if this has to do with the fact that there is a preference option that allows these data types and JSL is not "smart" enough to know whether this is enabled but the GUI is.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TomF_0-1642171714249.png" style="width: 255px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38987i61D1B4ACE6F585D2/image-dimensions/255x290?v=v2" width="255" height="290" role="button" title="TomF_0-1642171714249.png" alt="TomF_0-1642171714249.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compressing is a solution, but I'd still be interested if anyone knows how to set modeling type before populating the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 15:42:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/452384#M69911</guid>
      <dc:creator>TomF</dc:creator>
      <dc:date>2022-01-19T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: How to change a column to a 1-byte integer</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/452450#M69916</link>
      <description>&lt;P&gt;Here is an example to make a new variable as a data column with a short word length for signed integers using a single byte.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

// open target data table
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// set JMP preferences to accept short numeric words
Set Preference( Allow short numeric data format( 1 ) );

// create a new column using shortened numeric data type
shorty = dt &amp;lt;&amp;lt; New Column( "Short Age", Numeric( 1 ), Continuous,
	Values( :age &amp;lt;&amp;lt; Get As Matrix )
);

// your done. maybe set preference back to default
Set Preference( Allow short numeric data format( 0 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jan 2022 17:38:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/452450#M69916</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-01-19T17:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: How to change a column to a 1-byte integer</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/452508#M69922</link>
      <description>&lt;P&gt;To set an existing column to 1-byte format look at this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// set JMP preferences to accept short numeric words
Set Preference( Allow short numeric data format( 1 ) );

dt = New Table( "Untitled",
	Add Rows( 3 ),
	New Column( "1 Byte Format",
		Numeric( 1 ),
		"Continuous",
		Set Values( [1, 2, 3] )
	),
	New Column( "New Column",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [4, 5, 6] )
	)
);

dt:New Column &amp;lt;&amp;lt; set data type("numeric", 1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jan 2022 20:10:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/452508#M69922</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2022-01-19T20:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: How to change a column to a 1-byte integer</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/874663#M103844</link>
      <description>&lt;P&gt;Please note.&lt;BR /&gt;&lt;BR /&gt;N bit interger type is nice to compress the columns.&lt;BR /&gt;&lt;BR /&gt;On the other hand, the user has to take care with subsequent calculations, especially when the calculation is started via the&amp;nbsp;&lt;BR /&gt;right click / New Formula column / Formula menu:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1747733407108.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75988i12B39C53604A5915/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1747733407108.png" alt="hogi_1-1747733407108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Let's start with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "numeric data",
	Add Rows( 3 ),
	New Column( "numeric 1 byte Integer",
		Numeric( 1 ),
		Set Values( [1,2,3] ),
	),
	New Column( "numeric (default)",
		Numeric,
		Set Values( [10,20,30] ),
	)	
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and calculate&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1747733397746.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75987i94B37376E8051B29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1747733397746.png" alt="hogi_0-1747733397746.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;JMP copies the data type of the input column an instead of 0.1 it will return:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_2-1747733476260.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75989iFA1473A5D2DEE761/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_2-1747733476260.png" alt="hogi_2-1747733476260.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;On the other hand, when the user selects both input column and calculates the "ratio" via:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_3-1747733510604.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75990iB3DB32B84D52C5D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_3-1747733510604.png" alt="hogi_3-1747733510604.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;JMP creates the column with&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_4-1747737308686.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75992iC18231DEA91BD8A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_4-1747737308686.png" alt="hogi_4-1747737308686.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;setting ... and the result is 0.1:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_6-1747737370286.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75994iBED3FF5C639DDB08/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_6-1747737370286.png" alt="hogi_6-1747737370286.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 10:42:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-How-to-change-a-column-to-a-1-byte-integer/m-p/874663#M103844</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-05-20T10:42:42Z</dc:date>
    </item>
  </channel>
</rss>

