<?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 Multiple Column Group Name with jsl in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Recode-Multiple-Column-Group-Name-with-jsl/m-p/712397#M89576</link>
    <description>&lt;P&gt;I have column groups that needed frequent recoding. It works just by copying the enhanced log but how do I combine them together so that the code is less clunky?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );


// Change column name: name → Student's name
Data Table( "Big Class" ):name &amp;lt;&amp;lt; Set Name( "Student's name" );


// Change column name: age → Student's age
Data Table( "Big Class" ):age &amp;lt;&amp;lt; Set Name( "Student's age" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 24 Dec 2023 23:06:53 GMT</pubDate>
    <dc:creator>Tavuk89</dc:creator>
    <dc:date>2023-12-24T23:06:53Z</dc:date>
    <item>
      <title>Recode Multiple Column Group Name with jsl</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-Multiple-Column-Group-Name-with-jsl/m-p/712397#M89576</link>
      <description>&lt;P&gt;I have column groups that needed frequent recoding. It works just by copying the enhanced log but how do I combine them together so that the code is less clunky?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );


// Change column name: name → Student's name
Data Table( "Big Class" ):name &amp;lt;&amp;lt; Set Name( "Student's name" );


// Change column name: age → Student's age
Data Table( "Big Class" ):age &amp;lt;&amp;lt; Set Name( "Student's age" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Dec 2023 23:06:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-Multiple-Column-Group-Name-with-jsl/m-p/712397#M89576</guid>
      <dc:creator>Tavuk89</dc:creator>
      <dc:date>2023-12-24T23:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recode Multiple Column Group Name with jsl</title>
      <link>https://community.jmp.com/t5/Discussions/Recode-Multiple-Column-Group-Name-with-jsl/m-p/712410#M89579</link>
      <description>&lt;P&gt;You can use the Column Name Recode&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Cols=&amp;gt;Column Names=&amp;gt;Recode Column Names....&lt;/P&gt;
&lt;P&gt;If you do it once, you will see the JSL in the log as to what the JSL was that will create recodes&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Recode column names
Local( {dt = Data Table( "Big Class" ), names},
	names = Recode(
		dt &amp;lt;&amp;lt; Get Column Names( String ),
		{Map Value(
			_rcOrig,
			{"age", "s age", "height", "s height", "name", "s name", "sex", "s sex",
			"weight", "s weight"},
			Unmatched( _rcNow )
		)}
	);
	For Each( {name, i}, names, Column( dt, i ) &amp;lt;&amp;lt; Set Name( name ) );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It is also pretty easy to get a list of column names, and from that, make names changes across all of the columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

nameList = dt &amp;lt;&amp;lt; get column names( string );

For Each( {col}, nameList,
	Column( col ) &amp;lt;&amp;lt; set name( "Student's " || col )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Dec 2023 03:23:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Recode-Multiple-Column-Group-Name-with-jsl/m-p/712410#M89579</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-25T03:23:26Z</dc:date>
    </item>
  </channel>
</rss>

