<?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 Recode a column using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190713#M40964</link>
    <description>&lt;P&gt;I would like to recode (by JSL) a column using the 'Split On' advanced option 'Split Delimiter'= (Text)...&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2019 14:03:06 GMT</pubDate>
    <dc:creator>olivier_brack</dc:creator>
    <dc:date>2019-04-02T14:03:06Z</dc:date>
    <item>
      <title>Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190713#M40964</link>
      <description>&lt;P&gt;I would like to recode (by JSL) a column using the 'Split On' advanced option 'Split Delimiter'= (Text)...&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:03:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190713#M40964</guid>
      <dc:creator>olivier_brack</dc:creator>
      <dc:date>2019-04-02T14:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190722#M40965</link>
      <description>&lt;P&gt;Did you perform the task manually to verify the results are what you want? If so, did you save the results in a new data column with a formula? If so, then examine the formula to see how it might be done in a script.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:05:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190722#M40965</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-02T14:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190742#M40967</link>
      <description>&lt;P&gt;Hi, Mark&lt;/P&gt;&lt;P&gt;Yes but the result is a match formula&lt;/P&gt;&lt;P&gt;I would like, if possible, to script the recoding, using recode options&lt;/P&gt;&lt;P&gt;something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt_:var_name &amp;lt;&amp;lt; recode(split delimiter text("String"))....&lt;/P&gt;&lt;P&gt;I don't know if that's possible.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:24:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190742#M40967</guid>
      <dc:creator>olivier_brack</dc:creator>
      <dc:date>2019-04-02T14:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190756#M40971</link>
      <description>&lt;P&gt;My suggestion is similar to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;.&amp;nbsp; But rather than saving the column's formula, you can manually create the recode, but before actually completing the recode, you can go to the red triangle, and select&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Script==&amp;gt;Save to Script Window&lt;/P&gt;
&lt;P&gt;and it will show you the scrip&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: inherit; font-size: 16px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; line-height: 1.7142; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;t necessary to generate the recode you have specified&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Data Table() &amp;lt;&amp;lt; Begin Data Update;
dc1 = New Column( :weight );
dc1 &amp;lt;&amp;lt; Set Name( "weight 2 2" );
Current Data Table() &amp;lt;&amp;lt; Go to( dc1 );
Current Data Table() &amp;lt;&amp;lt; Move Selected Columns( after( :weight ) );
For Each Row(
	dc1[] = Match( :weight,
		64, 60,
		67, 60,
		74, 70,
		79, 70,
		81, 80,
		84, 80,
		85, 80,
		91, 90,
		92, 90,
		93, 90,
		95, 90,
		98, 90,
		99, 90,
		104, 100,
		105, 100,
		106, 100,
		107, 100,
		111, 110,
		112, 110,
		113, 110,
		115, 110,
		116, 110,
		119, 110,
		123, 120,
		128, 120,
		134, 130,
		142, 140,
		145, 140,
		172, 170,
		:weight
	)
);
Current Data Table() &amp;lt;&amp;lt; End Data Update;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:52:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190756#M40971</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-04-02T14:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190757#M40972</link>
      <description>&lt;P&gt;Thank you but I'ld to avoid the match scripting because this recoding will be implemented within a global script and the text delimiter could be changed by my user depending on the column to be recoded.&lt;/P&gt;&lt;P&gt;That's why i'ld prefer, if possible, to write the recoding function using options...&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 15:01:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190757#M40972</guid>
      <dc:creator>olivier_brack</dc:creator>
      <dc:date>2019-04-02T15:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190758#M40973</link>
      <description>&lt;P&gt;Right, so you know it works. Now, copy that formula and paste it over the 'recode expression' in this script to accomplish the same thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Data Table() &amp;lt;&amp;lt; New Column( "Recoded",
	Formula( recode expression )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 15:03:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190758#M40973</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-02T15:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190759#M40974</link>
      <description>&lt;P&gt;I think that you need to consider all the character functions in JSL to make a formula of your own and either save it as a new column (recoded values) or use the expression to compute the values row-wise without a script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your descriptions so far are too vague to permit anyone to offer more specific suggestions.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 15:05:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190759#M40974</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-02T15:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190762#M40977</link>
      <description>&lt;P&gt;Thank you Mark&lt;/P&gt;&lt;P&gt;If I understand well, the recode function doesn't exist in JSL...&lt;/P&gt;&lt;P&gt;So, we're not able to script what we do manually using the red triangle options (Split on, advanced, ...) proposed when we recode a column.&lt;/P&gt;&lt;P&gt;I'll use the basic character functions...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 15:47:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190762#M40977</guid>
      <dc:creator>olivier_brack</dc:creator>
      <dc:date>2019-04-02T15:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190764#M40979</link>
      <description>&lt;P&gt;Thank you all&lt;/P&gt;&lt;P&gt;This problem is solved...&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 16:12:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190764#M40979</guid>
      <dc:creator>olivier_brack</dc:creator>
      <dc:date>2019-04-02T16:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Recode a column using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190765#M40980</link>
      <description>&lt;P&gt;That is correct, Recode is a column action, not a JSL function. There is a data column message &amp;lt;&amp;lt; Recode that opens the interactive recoding editor but there is nothing to automatically apply recoding rules. On the other hand, the collection of character string functions is rich and offers a lot of help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide examples of the original values and the desired recoded results? That might allow us to make better suggestions, if you still want more help.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 16:30:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-a-column-using-JSL/m-p/190765#M40980</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-02T16:30:49Z</dc:date>
    </item>
  </channel>
</rss>

