cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
terapin
Level VI

JSL code for File Open if file exists

Hi Folks,

I have some JSL code that opens a series of files (both a *.jmp and *.dat) and then performs various data management activities on them (namely, testing for presence of new data and then concatenating only the new data). The code runs fine as long as all the files are present.  There are some cases where a particular data file hasn't been collected and I want the JSL code to run for those data files that exist.  Currently, the JSL code stops if a file specified in my dt = Open  ( ......) doesn't exist.  I am looking for a way to test for whether a *.dat file exists and to open it if does or jump to next section of code if it doesn't.  Is there a way to do this in JSL?  Any suggestions would be very much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: JSL code for File Open if file exists

At least in JMP 10 there is a function File Exists() that could be useful here.

For( i = 1, i <= n_files, i++,

  If( File Exists( "path" ),

  my dt = Open( "path" ); // more code...

  )

);

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: JSL code for File Open if file exists

At least in JMP 10 there is a function File Exists() that could be useful here.

For( i = 1, i <= n_files, i++,

  If( File Exists( "path" ),

  my dt = Open( "path" ); // more code...

  )

);

terapin
Level VI

Re: JSL code for File Open if file exists

Thanks MS,

I knew there must be some command for this task. 

Recommended Articles