cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
bsl
bsl
Level II

Combine 3 journals into 1 journal

Hi,

I would like to combine 3 journals file into 1, and save the final journal in PDF format.

 

Journal_1 = Journal:G_Si_Wafer_Table

Journal_2 = Journal:G_Si_Wafer_Mapping

Journal_3 = Journal:G_Si_Wafer_Reject_Pareto

 

How to combine 3 Journals into 1, how to save as PDF, and how to close all 3 journals after save a PDF.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Combine 3 journals into 1 journal

Here is an annotated script that should help you understand the issue

Names Default To Here( 1 );

// Open sample data
dt = Open( "$SAMPLE_DATA/big class.jmp" );

// Create 2 journal windows, naming them what appears to be "Journal_1"
// and "Journal_2"
// Also assign the JSL variables j1 and j2 to the journals
j1 = New Window( "Journal_1", <<journal, dt << bivariate( x( :weight ), y( :height ) ) );

j2 = New Window( "Journal_2", <<journal, dt << oneway( x( :sex ), y( :weight ) ) );

// Create an empty journal window to move the other journals into
jFinal = New Window( "Final", <<journal );

// There are 2 methods below that can be used to append the journals to the 
// final journal
// ^Journal pointer final^ << append( ^Journal pointer Journal_1^);
// jFinal << append( j1 );
// or
// window("final journal window name") << append( window("journal 1 window name"));
// window("Journal: Final") << append( window( "Journal: Journal_1"))

jFinal << append( j1 );

Window( "Journal: Final" ) << append( Window( "Journal: Journal_2" ) );

// The real name of the journal window is the key.  Even though the code gives the name of
// the journal windows as "Journal_1", "Journal_2" and "Final", that is not the actual name.
// "Journal: Journal_1" etc. is the name.  However, if one explictly assigns a name to
// journal, such as
//  j1 << set window title( "Journal_1" );
// the window's name will be "Journal_1"

jFinal2 = New Window( "Final 2" );
jFinal2 << set window title( "Final 2" );
j1 << set window title( "Journal_1" );
j2 << set window title( "Journal_2" );

Window( "Final 2" ) << append( Window( "Journal_1" ) );
Window( "Final 2" ) << append( Window( "Journal_2" ) );
Jim

View solution in original post

5 REPLIES 5
txnelson
Super User

Re: Combine 3 journals into 1 journal

To accomplish what you are looking for, is to simply Append() the journals together.  The example below creates a new journal window, appends the 3 journals together, and then saves it as a PDF.

nw=new window("final",<<journal);

nw<<append(Journal_1); nw<<append(Journal_2); nw<<append(Journal_3); nw << Save PDF( "$TEMP/example.pdf" ); open("$TEMP/example.pdf");

Documentation on working with journals is covered in the Scripting Guide

     Help==>Books==>Scripting Guide

Jim
bsl
bsl
Level II

Re: Combine 3 journals into 1 journal

Hi,

I don't know why the all 3 journals still does not append to the final journal. This is the error from log.

 


Not a display in access or evaluation of 'append' , append( "Journal_1" ) /*###*/

In the following script, error marked by /*###*/
nw = New Window( "final", <<journal );
nw << append( "Journal_1" ) /*###*/;
nw << append( "Journal_2" );
nw << append( "Journal_3" );
nw << Save PDF( "$TEMP/example.pdf" );
Open( "$TEMP/example.pdf" );

txnelson
Super User

Re: Combine 3 journals into 1 journal

You have quotes around "journal_1".  In my script, I am assuming that Journal_1 was a JSL variable pointing to the journal.  Is this not the case?

Jim
bsl
bsl
Level II

Re: Combine 3 journals into 1 journal

I have 3 individual journals and named as Journal_1, Journal_2, & Journal_3 respectively. Each journal has Bar chart, pie char...etc.

txnelson
Super User

Re: Combine 3 journals into 1 journal

Here is an annotated script that should help you understand the issue

Names Default To Here( 1 );

// Open sample data
dt = Open( "$SAMPLE_DATA/big class.jmp" );

// Create 2 journal windows, naming them what appears to be "Journal_1"
// and "Journal_2"
// Also assign the JSL variables j1 and j2 to the journals
j1 = New Window( "Journal_1", <<journal, dt << bivariate( x( :weight ), y( :height ) ) );

j2 = New Window( "Journal_2", <<journal, dt << oneway( x( :sex ), y( :weight ) ) );

// Create an empty journal window to move the other journals into
jFinal = New Window( "Final", <<journal );

// There are 2 methods below that can be used to append the journals to the 
// final journal
// ^Journal pointer final^ << append( ^Journal pointer Journal_1^);
// jFinal << append( j1 );
// or
// window("final journal window name") << append( window("journal 1 window name"));
// window("Journal: Final") << append( window( "Journal: Journal_1"))

jFinal << append( j1 );

Window( "Journal: Final" ) << append( Window( "Journal: Journal_2" ) );

// The real name of the journal window is the key.  Even though the code gives the name of
// the journal windows as "Journal_1", "Journal_2" and "Final", that is not the actual name.
// "Journal: Journal_1" etc. is the name.  However, if one explictly assigns a name to
// journal, such as
//  j1 << set window title( "Journal_1" );
// the window's name will be "Journal_1"

jFinal2 = New Window( "Final 2" );
jFinal2 << set window title( "Final 2" );
j1 << set window title( "Journal_1" );
j2 << set window title( "Journal_2" );

Window( "Final 2" ) << append( Window( "Journal_1" ) );
Window( "Final 2" ) << append( Window( "Journal_2" ) );
Jim