Subscribe Bookmark RSS Feed

Script not working in JMP 11

bhagbom

Community Trekker

Joined:

Jun 23, 2011

I have a script that had been working in JMP 10 but now is not with JMP 11.  Someone else created this script so I'm learning my way through it.  The portion of the script that is causing problems is pasted below.  More specifically, I believe it is in the portion highlighted blue.  Any ideas?? 

ChronJoin=Function({}, //02

       //Joins data in the chronological order

       for( f = 2, f <= N Items(ShortList), f++,

           try(

               dt = open(directory || ShortList),

           /*catch*/

               print("Error 002a: Unrecognized file type "|| ShortList);

               throw();

          );

          if(!contains(column name(1), "Date"),  //if the column name of column one is not Date

               RowRemove("Date", 1, "Time", 2);  //removes headers

               ColumnRename(ShortList);  //renames the columns

          );

          FixRawSecondsName();

          ColumnFormat();  //sets the correct data types for the columns

          if(N Items(MultiVarCheckBox << Get Selected())!=0,

               MultiVarColumn(ShortList);

          );

          if(N Items(HALTlinesCheckBox << Get Selected())!=0, //Verticle Reference Lines selected

               if(TestTypeRadioBox << Get()==1,  //HALT

                    HALTstages(ShortList),

               /*else if*/TestTypeRadioBox << Get()==4,

                    SAstages(ShortList);

               );

          );

          try(  //if dt cannot be joined, an error is printed to the log and the script is stopped

               dtPrev = dtMain;

               dtMain = dtMain << Join(

                    With(dt),

                    Merge Same Name Columns,

                    Copy Formula(0),

                    Suppress Formula Evaluation(0),

                    By Matching Columns(:Date == :Date, :Time == Time),  //joins by matching Dates and Times

                    Drop Multiples (1, 1),

                    Name("Include non-matches")(1, 1),

                    Output Table Name("Digital" || char(f), nosave);

               ),

          /*catch*/

               print("Error 002b: Failure to join "||ShortList);

               throw(); //ends current script sequence

          );

               close(dt, nosave );  //closes the recently opened data table

               close(dtPrev, nosave);  //closes the previous data table

     );

     while(contains(column name(1), "Match Flag"),

          dtMain << Delete Columns("Match Flag");

     );

);

6 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

I have not studied your code at all closely but I do notice that in this line:

By Matching Columns(:Date == :Date, :Time == Time),  //joins by matching Dates and Times


there is no colon in front of the second reference to Time.

bhagbom

Community Trekker

Joined:

Jun 23, 2011

Thanks mpb for catching that.  I made the correction however that did not resolve it.

pmroz

Super User

Joined:

Jun 23, 2011

Look in the log and tell us what the error message says.

bhagbom

Community Trekker

Joined:

Jun 23, 2011

The only message in the log is what the script is printing to the log.  It failing to join the two files together.  I am able to manually join the files together.

/*catch*/

               print("Error 002b: Failure to join "||ShortList);

               throw(); //ends current script sequence

          );

pmroz

Super User

Joined:

Jun 23, 2011

In the manually joined table, click on the little red triangle next to Source, then click Edit.  Compare that JSL code to the code you have listed here.

bhagbom

Community Trekker

Joined:

Jun 23, 2011

PMroz, I took your suggestion and found the difference.  It worked in JMP 10 as the following:

     dtMain = dtMain << Join(

I am able to make it work in JMP 11 with:

     dtMain = Data Table (dtMain) << Join(

Thanks for the help!