Hi All,
I'm struggling with how to get around Parse() adding extra spaces because it's interfering with the evaluation of my code.
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:
Eval(
Parse(
"\[report_of_interest[Number Col Box( 8 )] << Simulate(
NBSnum,
Random Seed( RSnum ),
Out( ]\"
|| YCols[1] || "\[ ),
In( :Simulated Y )
);]\"
)
);
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: "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:
report_of_interest[Number Col Box( 8 )] << Simulate(
NBSnum,
Random Seed( RSnum ),
Out( AA BBB CCC( d - d ) ),
In( :Simulated Y )
)
Is there a way to get around this, or another way to build the string for parsing that won't add the extra spaces?
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.
str = Eval Insert(
"report_of_interest[Number Col Box( 8 )] << Simulate(
NBSnum,
Random Seed( RSnum ),
Out("
);
str2 = Eval Insert( " ),
:Simulated Y )
)" );
Eval( Parse( str || ":" || Char( Eval( YCols )[1] ) || str2 ) );
I know JSL doesn't care about the extra white spaces, but JMP does when it comes to column names.
Any thoughts/ideas are much appreciated.
Thanks!,
DS