<?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: Recode multiple values in multiple columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85802#M38309</link>
    <description>&lt;P&gt;You have 2 issues. &amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The proper syntax for using a subscript is to inclose it in "[ ]" not "( )".&lt;/LI&gt;
&lt;LI&gt;You need to tell JMP that Cols[i] is to be used as a column reference&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;See the corrected script below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cols = dtconcat &amp;lt;&amp;lt; get column names;
For Each Row(
	For( i = 1, i &amp;lt;= N Items( cols ), i++,
		As Column( cols[i] ) =
		Match( As Column( cols[i] ),
			"NQ", "0",
			"Nq", "0",
			"NA", ".",
			"N/A", ".",
			"&amp;gt;30", "30",
			"&amp;gt;20", "20",
			"&amp;lt;5", "0",
			"&amp;lt;2.00", "0",
			"&amp;lt;2.0", "0",
			"&amp;lt;2", "0",
			"&amp;lt;1", "0",
			"&amp;lt;0.5", "0",
			"&amp;lt;0.01", "0",
			"#N/A", ".",
			"-", "."
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Dec 2018 18:46:11 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-12-13T18:46:11Z</dc:date>
    <item>
      <title>Recode multiple values in multiple columns</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85793#M38304</link>
      <description>&lt;P&gt;Hello JMP Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am tying to recode 103 columns of data in a data table. There are quite a few recodes that need to happen in each column. I was trying to follow this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7865#M7859" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7865#M7859&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but use recode instead of "if".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think my problem is with the "cols" I used. I'm unsure how to reference the column I am targeting and move from one column to the next with each loop inside of the "for".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cols = dtconcat &amp;lt;&amp;lt; get column names;
For Each Row( For(i=1, i&amp;lt;=N Items(cols), i++,
	cols(i) = Match( cols(i),
		"NQ", "0",
		"Nq", "0",
		"NA", ".",
		"N/A", ".",
		"&amp;gt;30", "30",
		"&amp;gt;20", "20",
		"&amp;lt;5", "0",
		"&amp;lt;2.00", "0",
		"&amp;lt;2.0", "0",
		"&amp;lt;2", "0",
		"&amp;lt;1", "0",
		"&amp;lt;0.5", "0",
		"&amp;lt;0.01", "0",
		"#N/A", ".",
		"-", ".",
		cols(i))
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 16:20:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85793#M38304</guid>
      <dc:creator>MattP</dc:creator>
      <dc:date>2018-12-13T16:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple values in multiple columns</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85802#M38309</link>
      <description>&lt;P&gt;You have 2 issues. &amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The proper syntax for using a subscript is to inclose it in "[ ]" not "( )".&lt;/LI&gt;
&lt;LI&gt;You need to tell JMP that Cols[i] is to be used as a column reference&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;See the corrected script below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cols = dtconcat &amp;lt;&amp;lt; get column names;
For Each Row(
	For( i = 1, i &amp;lt;= N Items( cols ), i++,
		As Column( cols[i] ) =
		Match( As Column( cols[i] ),
			"NQ", "0",
			"Nq", "0",
			"NA", ".",
			"N/A", ".",
			"&amp;gt;30", "30",
			"&amp;gt;20", "20",
			"&amp;lt;5", "0",
			"&amp;lt;2.00", "0",
			"&amp;lt;2.0", "0",
			"&amp;lt;2", "0",
			"&amp;lt;1", "0",
			"&amp;lt;0.5", "0",
			"&amp;lt;0.01", "0",
			"#N/A", ".",
			"-", "."
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2018 18:46:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85802#M38309</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-12-13T18:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple values in multiple columns</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85807#M38313</link>
      <description>Thank you very much!</description>
      <pubDate>Thu, 13 Dec 2018 19:11:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-values-in-multiple-columns/m-p/85807#M38313</guid>
      <dc:creator>MattP</dc:creator>
      <dc:date>2018-12-13T19:11:33Z</dc:date>
    </item>
  </channel>
</rss>

