<?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: script to find and replace a numeric value with a missing value in the whole table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381042#M63157</link>
    <description>&lt;P&gt;Thanks for the code.&lt;/P&gt;&lt;P&gt;It worked fine on the numeric col's but for those who are char I added another loop:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Rows( dt1 ), i++,
	For( l = 1, l &amp;lt;= N Cols( dt1 ), l++,
		If( Column( l )[i] == "999",
			Column( l )[i] = ""
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All the best&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 19:57:56 GMT</pubDate>
    <dc:creator>eliyahu100</dc:creator>
    <dc:date>2021-04-29T19:57:56Z</dc:date>
    <item>
      <title>script to find and replace a numeric value with a missing value in the whole table</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/380971#M63149</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like a code that would find and replace the number 999 in the whole table into a missing value.&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:45:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/380971#M63149</guid>
      <dc:creator>eliyahu100</dc:creator>
      <dc:date>2023-06-09T19:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace a numeric value with a missing value in the whole table</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/380991#M63151</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7188"&gt;@eliyahu100&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This code should do it. If the value is not 999, then you can change it to whichever value it needs to check.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

For( i = 1, i &amp;lt;= N Rows( dt ), i++,
	For( l = 1, l &amp;lt;= N Cols( dt ), l++,
		If( Column( l )[i] == 999,
			Column( l )[i] = .
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this does it!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 18:56:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/380991#M63151</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-04-29T18:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace a numeric value with a missing value in the whole table</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381001#M63154</link>
      <description>&lt;P&gt;You can interactively replace the code 999 with missing using the Cols &amp;gt; Recode command. See the JMP Help for an explanation of &lt;A href="https://www.jmp.com/support/help/en/15.2/#page/jmp/recode-data.shtml" target="_self"&gt;Recode&lt;/A&gt;. It might not be the best choice for this case, but it is very powerful and often easier that writing a script.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 19:23:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381001#M63154</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-04-29T19:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace a numeric value with a missing value in the whole table</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381042#M63157</link>
      <description>&lt;P&gt;Thanks for the code.&lt;/P&gt;&lt;P&gt;It worked fine on the numeric col's but for those who are char I added another loop:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Rows( dt1 ), i++,
	For( l = 1, l &amp;lt;= N Cols( dt1 ), l++,
		If( Column( l )[i] == "999",
			Column( l )[i] = ""
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;All the best&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 19:57:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381042#M63157</guid>
      <dc:creator>eliyahu100</dc:creator>
      <dc:date>2021-04-29T19:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace a numeric value with a missing value in the whole table</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381257#M63175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7188"&gt;@eliyahu100&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You should be able to keep it to a single loop by including another test in the For loop that tests the column data or modeling type, and if == to "continuous" or "numerical", then it would perform the later actions of replacing the 999 with NaN.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; A very good resource that contains all the commands in JMP is the Scripting Index: Help &amp;gt; Scripting Index. You can type in the command (or as close to what you think it might be) and it will give suggestions, when you find the right command, there's always an example script to help show how that command is used. Very helpful and useful resource.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 12:44:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/381257#M63175</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-04-30T12:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: script to find and replace a numeric value with a missing value in the whole table</title>
      <link>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/637432#M83520</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7188"&gt;@eliyahu100&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You already have a good answer for how to actually replace the values, but another option to consider is to use &lt;A href="https://www.jmp.com/support/help/en/17.1/#page/jmp/properties-that-validate-column-values.shtml" target="_self"&gt;Missing Value Coding&lt;/A&gt; so that JMP treats those 999 values as missing. This will be faster for a table of any size, and preserves those missing value codes in your table (but will not use them in calculations or graphs). Below is some JSL to accomplish that, or you can set this property interactively:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;For( i = 1, i &amp;lt;= N Cols( dt ), i++,
	Column(dt,i) &amp;lt;&amp;lt; Set Property( "Missing Value Codes", {999} )
);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 15:16:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/script-to-find-and-replace-a-numeric-value-with-a-missing-value/m-p/637432#M83520</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2023-05-31T15:16:25Z</dc:date>
    </item>
  </channel>
</rss>

