cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
jlmbs
Level III

Error: Unexpected end of input. Perhaps there is a missing "," or ")".

Hello,

 

Whilst trying to automate data visualisation from a file I am encountering an error message after entering these lines of code

 

// Delete selected rows
dt( "Export" ) << select where(row() >= N Rows(dt) - 1;
dt << delete rows;

 

Here I would like to delete the last 2 rows of each file I open regardless of their length.

If you could help, that would be very much appreciated

 

 

Names Default To Here(1);

dt=Open(
myPath = Pick File( "Select Excel File", "$DOCUMENTS", {"Excel Files|csv;xlsx;xls", "All Files|*"}, 1, 0 ),
Worksheets( "Export" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 2 ),
Data Starts on Row( 3 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);


// Delete selected rows
dt( "Export" ) << select where(row() >= N Rows(dt) - 1;
dt << delete rows;


// Change column info: Result Id
dt( "Export" ):Result Id << Data Type( Character ) <<
Set Modeling Type( "Nominal" );


// Delete column: Statistics
dt( "Untitled 8" ) << Delete Columns( :Statistics );


// Change column info: %Area
dt( "Untitled 8" ):Column 6 << Set Name( "%Area" ) << Set Field Width( 3 );


// Change column name: Analysis Columns → Glycan Species
dt( "Untitled 8" ):Analysis Columns << Set Name( "Glycan Species" );


// Report snapshot: Untitled 8 - Graph Builder
dt( "Data analysis" ) << Graph Builder(
Size( 688, 586 ),
Variables( X( :Glycan Species ), Y( :"%Area"n ), Overlay( :SampleName ) ),
Elements( Bar( X, Y, Legend( 7 ) ) )
);


// Save data table: Data analysis.jmp
dt( "Untitled 8" ) << Save(path to work directory.jmp);


// Report snapshot: Export - Tabulate
dt( "Export" ) << Tabulate(
Add Table(
Row Table(
Grouping Columns( :Result Id, :SampleName, :Vial ),
Analysis Columns(
:Total alpha Gal, :Total beta Gal, :"G0-GN"n, :"G0f-GN"n, :G0,
:"G1-GN"n, :G0f, :M5, :"G1f-GN (a)"n, :"G1f (alpha 1,6)"n,
:"G1f (alpha 1,3)"n, :M6, :G2f, :"G1f+G (alpha 1,3)"n, :"G2f+G"n
)
)
)
);

 

Here is the error message:

Unexpected end of input. Perhaps there is a missing "," or ")".

Trying to parse arguments of function "select where" Line 78 Column 3:);

 

Thanks,

Julia

1 ACCEPTED SOLUTION

Accepted Solutions
Byron_JMP
Staff

Re: Error: Unexpected end of input. Perhaps there is a missing "," or ")".

When you see errors like that, it can be a little tricky to figure out where the missing comma or paren is supposed to be.

 

One way to figure it out is to start a couple of rows above where the error is and start clicking on the "("s. When you double click the section of script that JMP thinks is in the paren turns highlighted.   If the paren turns red or the highlighting doesn't make sense, you've found the problem.

 

Awesome to see you using the action recorder to automate, nice.

-B

JMP Systems Engineer, Health and Life Sciences (Pharma)

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Error: Unexpected end of input. Perhaps there is a missing "," or ")".

You are missing a ")" on this select where()

// Delete selected rows
dt( "Export" ) << select where( Row() >= N Rows( dt ) - 1 );
dt << delete rows;
Jim
Byron_JMP
Staff

Re: Error: Unexpected end of input. Perhaps there is a missing "," or ")".

When you see errors like that, it can be a little tricky to figure out where the missing comma or paren is supposed to be.

 

One way to figure it out is to start a couple of rows above where the error is and start clicking on the "("s. When you double click the section of script that JMP thinks is in the paren turns highlighted.   If the paren turns red or the highlighting doesn't make sense, you've found the problem.

 

Awesome to see you using the action recorder to automate, nice.

-B

JMP Systems Engineer, Health and Life Sciences (Pharma)