<?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 columns with JSL script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7866#M7860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can have multiple statements within a for each row() clause. I.e. For Each Row( If( ... ); If( ... ), ... ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or perhaps better, loop over a list of columns (inside the For Each Row()-loop or stand-alone) as in the example below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Current Data Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;cols &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;get column names&lt;/STRONG&gt;;&lt;/SPAN&gt;// or any list of character columns&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;For Each Row&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #011993;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #011993;"&gt;++,&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;If&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"Blank"&lt;/SPAN&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #008f00;"&gt;// Alternatively...&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #011993;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #011993;"&gt;++,&lt;/SPAN&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][&lt;/STRONG&gt;dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;get rows where&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;""&lt;/SPAN&gt; &lt;STRONG&gt;)]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"Blank"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Dec 2013 21:02:40 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2013-12-17T21:02:40Z</dc:date>
    <item>
      <title>Recode multiple columns with JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7865#M7859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script with connects to an Access Database to retrieve some data for analysis.&amp;nbsp; In this data there are several columns which have some null information in the data set.&amp;nbsp; I know I can use the For Each Row command and recode a column to replace all the null data with the string "Blank".&amp;nbsp; Is there a way to script this to work on all columns or do i need to use the For Each Row command on each column I wish to recode?&amp;nbsp; I dont have a problem doing it that way, but it just seems there has to be a way to loop this for each column and shrink the code a bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now i have this:&lt;/P&gt;&lt;P&gt;For Each Row ( If( :Priority == "", :Priority = "Blank" ));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible i would simply like it to traverse through all the columns and anywhere there's no information to insert "Blank".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 20:24:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7865#M7859</guid>
      <dc:creator>buckmurdock</dc:creator>
      <dc:date>2013-12-17T20:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple columns with JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7866#M7860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can have multiple statements within a for each row() clause. I.e. For Each Row( If( ... ); If( ... ), ... ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or perhaps better, loop over a list of columns (inside the For Each Row()-loop or stand-alone) as in the example below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Current Data Table&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;cols &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; dt &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;get column names&lt;/STRONG&gt;;&lt;/SPAN&gt;// or any list of character columns&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;For Each Row&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #011993;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #011993;"&gt;++,&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;If&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"Blank"&lt;/SPAN&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #008f00;"&gt;// Alternatively...&lt;/P&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #011993;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #011993;"&gt;++,&lt;/SPAN&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][&lt;/STRONG&gt;dt &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;get rows where&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; cols&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;][]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;==&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;""&lt;/SPAN&gt; &lt;STRONG&gt;)]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"Blank"&lt;/SPAN&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 21:02:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7866#M7860</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2013-12-17T21:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple columns with JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7867#M7861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked perfectly.&amp;nbsp; Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 21:09:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/7867#M7861</guid>
      <dc:creator>buckmurdock</dc:creator>
      <dc:date>2013-12-17T21:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple columns with JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/54948#M31055</link>
      <description>&lt;P&gt;I have a similar request - how would I recode something with 40 columns with 3 options:&lt;/P&gt;&lt;P&gt;Questions 1 through 40 can have 3 possible outcomes: "1", "Completed", "0", "Incomplete", "NULL",&amp;nbsp; "Pending"&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 20:21:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/54948#M31055</guid>
      <dc:creator>noemireyes</dc:creator>
      <dc:date>2018-04-12T20:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple columns with JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/54954#M31059</link>
      <description>&lt;P&gt;Do you actually have to recode the values, or could you use Value Labels to just change the displaying of the values to the specified values?&amp;nbsp; If you can use Value Labels, then you can do the following&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Select All of the Columns you want to change&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Go to the Cols pull down menu and select "Standardize Attributes..."&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; Go to "Standardize Properties" and select the Value Labels column property.&lt;/P&gt;
&lt;P&gt;4.&amp;nbsp; Complete the Labeling dialog box and then Click on "OK"&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 21:11:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/54954#M31059</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-04-12T21:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Recode multiple columns with JSL script</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/54976#M31076</link>
      <description>&lt;P&gt;Thank you! That took care of it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 13:12:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-multiple-columns-with-JSL-script/m-p/54976#M31076</guid>
      <dc:creator>noemireyes</dc:creator>
      <dc:date>2018-04-13T13:12:28Z</dc:date>
    </item>
  </channel>
</rss>

