<?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: JSL escape character pattern  for comma(,) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212411#M42529</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12440"&gt;@dilipkumar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Without seeing more of your script I can't say why JMP is processing that variable in that manner. Actually, I would expect the entire string to always be returned unless you are doing extra work to take it apart based on the delimiter. Are you using a function such as Word() to peel away pieces of the string X? If you can share more I'm happy to help figure this out. Alternatively, if you wish to pass a single variable around, but want tighter control over what you reference in the variable, perhaps a list. From your description, it sounds like you want one element to be "abc" and another element "x,yz." The following jsl could help with that :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x = {"abc", "k,yz"};

print( x[1] ); //"abc"
print( x[2] ); //k,yz"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Jun 2019 17:22:30 GMT</pubDate>
    <dc:creator>jules</dc:creator>
    <dc:date>2019-06-08T17:22:30Z</dc:date>
    <item>
      <title>JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212396#M42525</link>
      <description>&lt;P&gt;Hi Can any one tell me how to escape comma (,) from a string. I know it for double quate (") it is \! but not aware for comma(,)&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 15:09:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212396#M42525</guid>
      <dc:creator>dilipkumar</dc:creator>
      <dc:date>2019-06-08T15:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212407#M42526</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12440"&gt;@dilipkumar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;No escape character needed for a comma, you can simply use them inside your quoted string:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-06-08 at 12.07.08 PM.png" style="width: 726px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17674i3948A9BA0ADD1704/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-06-08 at 12.07.08 PM.png" alt="Screen Shot 2019-06-08 at 12.07.08 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For reference, I've included the jsl escape sequences at the bottom of this post. But, are you encountering a situation where a comma in a string appears to cause some kind of error? I'm sure we can get to the bottom of what's happening if you can elaborate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="escapesequences.png" style="width: 734px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17675i77CBBB4995853BAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="escapesequences.png" alt="escapesequences.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 16:14:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212407#M42526</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-08T16:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212409#M42527</link>
      <description>Actually i have defined a variable x= "abc,k,yz". where abc is a first string where x,yz is the second string.&lt;BR /&gt;now if i am passing these variable through my script . during execution my script is taking variable x as abc,k and yz separately.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Dilip</description>
      <pubDate>Sat, 08 Jun 2019 17:01:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212409#M42527</guid>
      <dc:creator>dilipkumar</dc:creator>
      <dc:date>2019-06-08T17:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212411#M42529</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12440"&gt;@dilipkumar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Without seeing more of your script I can't say why JMP is processing that variable in that manner. Actually, I would expect the entire string to always be returned unless you are doing extra work to take it apart based on the delimiter. Are you using a function such as Word() to peel away pieces of the string X? If you can share more I'm happy to help figure this out. Alternatively, if you wish to pass a single variable around, but want tighter control over what you reference in the variable, perhaps a list. From your description, it sounds like you want one element to be "abc" and another element "x,yz." The following jsl could help with that :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x = {"abc", "k,yz"};

print( x[1] ); //"abc"
print( x[2] ); //k,yz"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2019 17:22:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212411#M42529</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-08T17:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212412#M42530</link>
      <description>&lt;P&gt;Here are some uses of passing a variable x="abc,k,yz"; in JSL, none of which cause an error.&amp;nbsp; Can you be more specific on where you are seeing an issue?&amp;nbsp; I can see it being a problem if it is being added to another literal string without quoting arond it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
x= "abc,k,yz";

rr=function({y},show(y));

rr(x);

dt=new table(new column(x,formula(random uniform())));
dt&amp;lt;&amp;lt;add rows(10);

Distribution( Continuous Distribution( Column( as column(x) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Jun 2019 17:30:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212412#M42530</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-06-08T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212414#M42532</link>
      <description>&lt;P&gt;Actually I need to fetch data from data base, based on the variable defined below(MN). If I am passing the MN in my jsl script and getting data of 3C22, Y MERS,.AAA-.75YIN . as a output&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Create Database Connection
dbc = Create Database Connection(
"XXX",

)
MN = "3C22,Y MERS,.AAA-.75YIN";// where 3C22 is one input and 2nd input is Y MERS,.AAA-.75YIN"

dataTable = New Table( "RAW DATA");

ddt = Data Table( 1 );

//Execute SQL statements using this connection

sqlQuery = "execute [dbo].[ABC] @MN = '" || MN|| "'";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Dilip&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2019 17:09:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212414#M42532</guid>
      <dc:creator>dilipkumar</dc:creator>
      <dc:date>2019-06-09T17:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212476#M42539</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12440"&gt;@dilipkumar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I understand the problem you're facing now. It looks like the issue might be that the database is parsing the commas in your query string in a way you don't want, not that JMP is.&amp;nbsp;SQL isn't my specialty, but I did a little searching and came across &lt;A href="https://stackoverflow.com/questions/46307811/sql-server-escape-punctuation-in-string" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; that discussed escaping characters, like commas, in SQL statements. The suggestion is to add double quotes to help identify the separate clauses since the comma alone isn't definitive if you're using commas elsewhere. In your example, that could look like the following when defining your MN variable, though I must say I don't have a way to test whether this will work so I offer it only as a possible suggestion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MN = " \!"3C22\!",\!"Y MERS,.AAA-.75YIN\!" ";
//  which stores the string, including quotes:
//        "3C22" , "Y MERS,.AAA-.75YIN"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 11:50:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212476#M42539</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-10T11:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212484#M42544</link>
      <description>&lt;P&gt;The way to debug this is to create a working command in native SQL Server ( I think that's the database you're using).&amp;nbsp; After that it's not hard to create the same string in JSL.&amp;nbsp; I have a suggestion to make the code a little easier to read.&amp;nbsp; If you use evalinsert and surround the MN variable with caret characters (^) that will accomplish the same thing:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sqlQuery = evalinsert("execute [dbo].[ABC] @MN = '^MN^'");
print(sqlquery);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result is:&lt;/P&gt;
&lt;PRE&gt;"execute [dbo].[ABC] @MN = '3C22,Y MERS,.AAA-.75YIN'"&lt;/PRE&gt;
&lt;P&gt;I think the problem is that this is incorrect SQL Server syntax.&amp;nbsp; You are setting the variable MN equal to the entire string.&amp;nbsp; Can a SQL Server expert chime in here?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 13:36:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212484#M42544</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2019-06-10T13:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212511#M42553</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi, Thanks for info.&lt;/P&gt;&lt;P&gt;Yes you have understood my problem correctly. But i don't need double quote to be there in output&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;MN &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;" \!"3C22\!",\!"Y MERS,.AAA-.75YIN\!" "&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token comment"&gt;//  which stores the string, including quotes:&lt;/SPAN&gt;
&lt;SPAN class="token comment"&gt;//        "3C22" , "Y MERS,.AAA-.75YIN" i&amp;nbsp;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;i need only &lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token comment"&gt;3C22&lt;/SPAN&gt;&lt;/CODE&gt;, &lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token comment"&gt;Y MERS,.AAA-.75YIN&lt;/SPAN&gt;&lt;/CODE&gt; as an output.&lt;/P&gt;&lt;P&gt;please suggest.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dilip&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 16:37:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212511#M42553</guid>
      <dc:creator>dilipkumar</dc:creator>
      <dc:date>2019-06-10T16:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: JSL escape character pattern  for comma(,)</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212522#M42554</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/12440"&gt;@dilipkumar&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;That appears to be what your initial jsl does. I'm not sure how an output as you stated, &lt;EM&gt;3C22,&amp;nbsp; Y MERS,.AAA-.75YIN&amp;nbsp;&lt;/EM&gt;&amp;nbsp; , will allow the query to identify which part of the string is each variable. The addition of quotes was a suggestion elsewhere to aid in distinguishing the individual components since the comma alone can not, but again, not being well versed in SQL I do not know if that is the best or even viable method.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 16:46:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-escape-character-pattern-for-comma/m-p/212522#M42554</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-10T16:46:04Z</dc:date>
    </item>
  </channel>
</rss>

