<?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 How to search in column headers? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3531#M3531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like he wants to display the error message, but continue with the remainder of the column rename functions.&amp;nbsp; You could do this with a modal dialog (requires you to click "OK" before the script will proceed) or a caption window (does not stop script or require a response), depending on your preference.&amp;nbsp; In the below examples, "old_name" refers to the column name you want to locate and replace and "new_name" refers to the name you want to replace it with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;col_names = dt &amp;lt;&amp;lt; get column names(string);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( !contains( col_names, "old_name" ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dlg = dialog( "No old_name column",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button( "Cancel" ), button( "OK" ) ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( dlg["Button"] == -1, Throw() ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column( "old_name" ) &amp;lt;&amp;lt; Set Name( "new_name" )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the non-modal caption command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;col_names = dt &amp;lt;&amp;lt; get column names(string);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( !contains( col_names, "old_name" ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caption( {x,y}, "No old_name column" );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wait( 2 );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caption( remove ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column( "old_name" ) &amp;lt;&amp;lt; Set Name( "new_name" )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x and y in the caption refer to display coordinates, so if your display resolution is 1024 x 768, using {500,350} will give you a caption window that is roughly in the middle of your screen.&amp;nbsp; You can also alter the time of the 'wait' command if the message is displaying too long (or not long enough).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to repeat the conditional for each column, replacing "old_name" and "new_name" each time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jul 2011 21:46:40 GMT</pubDate>
    <dc:creator>bgouaux</dc:creator>
    <dc:date>2011-07-12T21:46:40Z</dc:date>
    <item>
      <title>How to search in column headers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3529#M3529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new in JSL scripting and I want to know how to search in column headers.&lt;/P&gt;&lt;P&gt;Basically, I used data table prepared by other person that I need to analyze. Before I start analysis, I change the column headers through script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, sometimes the data table does not have the specific header I am chaging and the JSL script will abort.&lt;/P&gt;&lt;P&gt;Here my a part of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;col=Column("%L(i)_MRR"); col&amp;lt;&amp;lt;Set Name("irawLossMRR");&lt;/P&gt;&lt;P&gt;col=Column("%L(i)_QSNR - Production_Avg."); col&amp;lt;&amp;lt;Set Name("irawLossQSNR");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My probelm: If there is no "%L(i)_MRR" column header, the script will abort and will not execute the next command.&lt;/P&gt;&lt;P&gt;Requirement: How to show pop-up screen to show a message: "No %L(i)_MRR column" and proceed with the next command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- marknight -&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 10:44:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3529#M3529</guid>
      <dc:creator>marknight</dc:creator>
      <dc:date>2011-07-09T10:44:16Z</dc:date>
    </item>
    <item>
      <title>How to search in column headers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3530#M3530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would use something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;open&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"$sample_data\Big Class.jmp"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;col_names &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; dt &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; Get Column Names&lt;STRONG&gt;(&lt;/STRONG&gt;String&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;!&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;contains&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;col_names&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"first name"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dlg &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;dialog&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;(&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"Column not found"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"Warning column [first name] not found"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy; font-size: 10pt;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;"OK"&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;))&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: #0000dd; font-size: 10pt;"&gt;throw&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;()&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: black; font-size: 10pt; font-family: 'Courier New';"&gt;)&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the contains function is case sensitive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 12:19:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3530#M3530</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2011-07-11T12:19:44Z</dc:date>
    </item>
    <item>
      <title>How to search in column headers?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3531#M3531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like he wants to display the error message, but continue with the remainder of the column rename functions.&amp;nbsp; You could do this with a modal dialog (requires you to click "OK" before the script will proceed) or a caption window (does not stop script or require a response), depending on your preference.&amp;nbsp; In the below examples, "old_name" refers to the column name you want to locate and replace and "new_name" refers to the name you want to replace it with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;col_names = dt &amp;lt;&amp;lt; get column names(string);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( !contains( col_names, "old_name" ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dlg = dialog( "No old_name column",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button( "Cancel" ), button( "OK" ) ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( dlg["Button"] == -1, Throw() ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column( "old_name" ) &amp;lt;&amp;lt; Set Name( "new_name" )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the non-modal caption command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;col_names = dt &amp;lt;&amp;lt; get column names(string);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( !contains( col_names, "old_name" ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caption( {x,y}, "No old_name column" );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wait( 2 );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caption( remove ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Column( "old_name" ) &amp;lt;&amp;lt; Set Name( "new_name" )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x and y in the caption refer to display coordinates, so if your display resolution is 1024 x 768, using {500,350} will give you a caption window that is roughly in the middle of your screen.&amp;nbsp; You can also alter the time of the 'wait' command if the message is displaying too long (or not long enough).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll need to repeat the conditional for each column, replacing "old_name" and "new_name" each time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 21:46:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-search-in-column-headers/m-p/3531#M3531</guid>
      <dc:creator>bgouaux</dc:creator>
      <dc:date>2011-07-12T21:46:40Z</dc:date>
    </item>
  </channel>
</rss>

