<?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 Why does Parse() add extra spaces? And how to get around this? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701069#M88561</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm struggling with how to get around Parse() adding extra spaces because it's interfering with the evaluation of my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a data table where I have a column of interest that is named something like "AA BBBB CCC(d-d)", and I am doing an evaluation where I want to simulate the estimates of a fit that I've done. The section of code where I'm doing this is the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Parse(
		"\[report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(
			NBSnum,
			Random Seed( RSnum ),
			Out( ]\"
			|| YCols[1] || "\[ ),
			In( :Simulated Y )
			);]\"
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; This works great for the most part, but the Parse() command adds extra spaces when it parses the variable YCols[1], and when it does that, the Simulate platform thinks that the column doesn't exist because it's looking for a name with extra spaces. When I just evaluate the YCols[1], I get the column name as above:&amp;nbsp;"AA BBBB CCC(d-d)". But, when I Parse(YCols[1]), the actual code that Eval() then runs is using a column with a name that looks like this: "AA BBBB CCC( d - d )", which is not the correct column name because Parse() is putting in extra spaces between the parentheses and the letter "d", as well as extra spaces around the "-" dash character. This is the output in the embedded log when I run just the Parse() part of the code above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(&lt;BR /&gt;NBSnum,&lt;BR /&gt;Random Seed( RSnum ),&lt;BR /&gt;Out( AA BBB CCC( d - d ) ),&lt;BR /&gt;In( :Simulated Y )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Is there a way to get around this, or another way to build the string for parsing that won't add the extra spaces?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I've even tried the following way to build the string for parsing, but this also leads to the Simulate platform looking for a column name with extra spaces.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = Eval Insert(
	"report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(
	NBSnum,
	Random Seed( RSnum ),
	Out("
);
str2 = Eval Insert( "	),
	:Simulated Y )
	)" );
Eval( Parse( str || ":" || Char( Eval( YCols )[1] ) || str2 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; I know JSL doesn't care about the extra white spaces, but JMP does when it comes to column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Any thoughts/ideas are much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2023 18:54:17 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2023-11-20T18:54:17Z</dc:date>
    <item>
      <title>Why does Parse() add extra spaces? And how to get around this?</title>
      <link>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701069#M88561</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I'm struggling with how to get around Parse() adding extra spaces because it's interfering with the evaluation of my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have a data table where I have a column of interest that is named something like "AA BBBB CCC(d-d)", and I am doing an evaluation where I want to simulate the estimates of a fit that I've done. The section of code where I'm doing this is the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	Parse(
		"\[report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(
			NBSnum,
			Random Seed( RSnum ),
			Out( ]\"
			|| YCols[1] || "\[ ),
			In( :Simulated Y )
			);]\"
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; This works great for the most part, but the Parse() command adds extra spaces when it parses the variable YCols[1], and when it does that, the Simulate platform thinks that the column doesn't exist because it's looking for a name with extra spaces. When I just evaluate the YCols[1], I get the column name as above:&amp;nbsp;"AA BBBB CCC(d-d)". But, when I Parse(YCols[1]), the actual code that Eval() then runs is using a column with a name that looks like this: "AA BBBB CCC( d - d )", which is not the correct column name because Parse() is putting in extra spaces between the parentheses and the letter "d", as well as extra spaces around the "-" dash character. This is the output in the embedded log when I run just the Parse() part of the code above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(&lt;BR /&gt;NBSnum,&lt;BR /&gt;Random Seed( RSnum ),&lt;BR /&gt;Out( AA BBB CCC( d - d ) ),&lt;BR /&gt;In( :Simulated Y )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Is there a way to get around this, or another way to build the string for parsing that won't add the extra spaces?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I've even tried the following way to build the string for parsing, but this also leads to the Simulate platform looking for a column name with extra spaces.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;str = Eval Insert(
	"report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(
	NBSnum,
	Random Seed( RSnum ),
	Out("
);
str2 = Eval Insert( "	),
	:Simulated Y )
	)" );
Eval( Parse( str || ":" || Char( Eval( YCols )[1] ) || str2 ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; I know JSL doesn't care about the extra white spaces, but JMP does when it comes to column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Any thoughts/ideas are much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 18:54:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701069#M88561</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-11-20T18:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why does Parse() add extra spaces? And how to get around this?</title>
      <link>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701091#M88562</link>
      <description>&lt;P&gt;Try adding ""n around the column name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

YCols= {"AA BBBB CCC(d-d)", "b"};

Parse(
	"\[report_of_interest[Number Col Box( 8 )] &amp;lt;&amp;lt; Simulate(
		NBSnum,
		Random Seed( RSnum ),
		Out( "]\"
		|| YCols[1] || "\["n ),
		In( :Simulated Y )
		);]\"
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Nov 2023 18:57:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701091#M88562</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-20T18:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why does Parse() add extra spaces? And how to get around this?</title>
      <link>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701145#M88569</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;That did it!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2023 20:24:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701145#M88569</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2023-11-20T20:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why does Parse() add extra spaces? And how to get around this?</title>
      <link>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701146#M88570</link>
      <description>&lt;P&gt;And you should be able to avoid using Parse in this case (if you want to)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; New Column("height+weight", Numeric, Continuous, Formula(
	:height + :weight
));

dist = dt &amp;lt;&amp;lt; Distribution(Continuous Distribution(Column(:height)));
ncb = Report(dist)[OutlineBox("Summary Statistics"), Number Col Box(1)];


mycol = "height+weight";
Eval(EvalExpr(
	ncb &amp;lt;&amp;lt; Simulate(
		20,
		Random Seed(1),
		Out(:height),
		In(Expr(NameExpr(AsColumn(dt, mycol))))
	)
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see if you run EvalExpr() part, that the column name gets built into "height+weight"n here&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ncb &amp;lt;&amp;lt; Simulate(20, Random Seed(1), Out(:height), In(:"height+weight"n))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Nov 2023 20:32:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Why-does-Parse-add-extra-spaces-And-how-to-get-around-this/m-p/701146#M88570</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-20T20:32:25Z</dc:date>
    </item>
  </channel>
</rss>

