JSL Companion

Book description

Confidently navigate your JMP Scripting Language journey with this example-driven guide!

With more than 200 example scripts and applications, JSL Companion: Applications of the JMP Scripting Language, Second Edition provides scripters with a resource that takes them beyond the basics of the JMP Scripting Language (JSL) and serves as a companion to writing applications. Avid JSL scripters Theresa L. Utlaut, Georgia Z. Morgan, and Kevin C. Anderson have tapped their expertise to write a task-oriented approach that allows readers to learn scripting by immersion.

This edition builds on the earlier edition with substantial new content for scripting enhanced JMP features, such as Graph Builder, new query methods, and enriched display box functionality. A new chapter is dedicated to creating applications with the Add-In Builder and Application Builder. The “Know Your Tools” topic has been expanded, including a section on how to use the JMP Debugger.

The book begins with an introduction that is intended for the JSL novice and quickly moves into the building blocks of JSL, which include input and output, working with data tables, script-writing essentials, and JMP data structures. The next chapters provide the foundation for building an application and focus on creating reports, communicating with users, customizing displays, and writing flexible scripts. The final chapters include building and deploying applications and helpful tips on planning scripts, debugging, and improving performance.

Table of contents

  1. About This Book
  2. About These Authors
  3. Acknowledgments
  4. Chapter 1 Getting Started with JSL
    1. Introduction
    2. The Power of JMP and JSL
    3. The Basics
      1. Create and Run a Script
      2. Open, Modify, and Save a Script
      3. Make It Stop!
    4. The Script Window
      1. Understand the Features of the Script Window
      2. Change Script Window Preferences
    5. The Log Window
      1. View the Log Window
      2. Send Messages to the Log Window
      3. Clear and Save
      4. Review Error Messages
      5. Get Help with Your Script
    6. Let JMP Write Your Script
      1. Capture a JSL Script from a Report
      2. Capture By-Groups Analysis
      3. Capture Table Manipulations
      4. Get More Help with Your Script
    7. Objects and Messages
      1. Reference Objects
      2. Send a Message
    8. Punctuation and Spacing
      1. Use Punctuation
      2. Use Spacing
    9. Rules for Naming Variables
    10. Operators
    11. Lists: A Bridge to Next-Tier Scripting
  5. Chapter 2 Reading and Saving Data
    1. Introduction
    2. Read Data into Data Tables
      1. Text Files
      2. Excel Files
      3. HTML Tables
      4. Zipped Files
      5. Other Data File Formats
    3. Set Column Formats
    4. Create Data Tables
      1. Add a List or Matrix of Values to a Data Table
    5. Close and Save Data Tables
      1. File Requirements
    6. Retrieve Data from a Database
    7. Read Multiple Files in a Directory
      1. File Selection Functions
      2. Three Scenarios of File Selection
      3. Commands for File Selection
    8. Parse Messy Text Files
      1. Two-Pass Open Method
      2. Load Text File
      3. Parse with Patterns
    9. Parse XML Files
      1. Write XML
  6. Chapter 3 Modifying and Combining Data Tables
    1. Introduction
    2. Create and Delete Columns
      1. Data Type and Modeling Type
      2. Column Values
      3. Column Formulas
      4. Example
      5. A Few Items to Note
    3. Modify Column Information
      1. Example
      2. Column Names
      3. Data Types
      4. Modeling Types
      5. Column Formats
      6. Column Properties
      7. Example
      8. A Few Items to Note
      9. Row States
      10. Assign Row States
      11. Get and Set Row States
      12. Save and Restore Row States
      13. A Few Items to Note
    4. Manipulate and Modify Portions of a Table
      1. Select and Reference Rows
      2. Get, Set, and Clear Column and Row Selections
      3. Assign Values to Selected Rows
      4. A Few Items to Note
    5. Data Table Variables, Scripts, and Other Information
      1. Example
      2. Important Note
      3. A Few Items to Note
    6. Restructure Tables
      1. Example
      2. FAQs
      3. A Few Items to Note
    7. Subset Tables
      1. Subset Message Syntax
      2. Query Method
      3. A Few Items to Note
    8. Join Tables
      1. Using Join
      2. Inner Join
      3. Cartesian Join
      4. Outer Joins
      5. Left Outer Join
      6. Duplicate Records
      7. SQL and Virtual, Natural Joins
      8. Left Outer Join Using Query
      9. A Few Items to Note
      10. Virtual, Natural Join
      11. Example
    9. Data Cleansing
  7. Chapter 4 Essentials: Variables, Formats, and Expressions
    1. Introduction
    2. Create Variables
      1. Send Messages
      2. Evaluate Variables
    3. Scope Variables
    4. JMP Functions
    5. Use Formulas
      1. Control Formula Evaluation
      2. An Alternative to Setting Formulas
      3. Use Variables in Formulas
    6. Check for Values and Data Types
      1. Boolean Inquiry Functions
      2. Type Function
    7. Conditional Functions
      1. If Function
      2. Match Function
      3. Choose Function
    8. User-Defined Functions
    9. Iterate
      1. For Each Row and Set Each Value
      2. Summation and Product Functions
      3. For and While Functions
    10. Script Timing and Execution
      1. Use the Wait Function
      2. Run Formulas
      3. Control Expression Evaluation
    11. JMP Dates
    12. Expressions
      1. Get Started
      2. Variables and Formulas
      3. Dialog Boxes
      4. Buttons in Interactive Graphs
  8. Chapter 5 Lists, Matrices, and Associative Arrays
    1. Introduction
    2. Lists and Their Applications
      1. Examples and Evaluation
      2. Reference Items
    3. Information from Lists
    4. Manipulate Lists
      1. Algebra and Special Assignments
    5. Matrix Structure in JSL
    6. Manipulate Matrices and Use Operations
    7. Matrices and Data Tables
    8. Matrix Examples
    9. Associative Arrays
      1. Create an Associative Array
      2. Remove Items
    10. Associative Array Applications
      1. Dictionary
      2. Enumerating Data Structure
  9. Chapter 6 Reports and Saving Results
    1. Introduction
    2. Create an Analysis
      1. General Syntax
      2. Reference the Analysis Layer
      3. ActionChoice Messages
      4. Boolean Messages
      5. By and Where
      6. Use Variable References
      7. Customize a Curve
    3. The Report Layer
      1. Show Tree Structure
      2. Reference the Report Layer
    4. Display Box Scripting
      1. NumberColBox
      2. OutlineBox
      3. AxisBox
      4. Examples
      5. A Few Items to Note
    5. Navigate a Report
      1. Navigation Path Syntax
      2. Single Analysis Structure and Examples
      3. Multiple Variable Report Structure
    6. Extract Information from a Report
    7. Create Custom Reports
    8. Scriptable Object and XPath
      1. Scriptable Object
      2. XPath
    9. Save Results
      1. Save One Report
      2. Save a Picture or Selection
      3. Save with By Group
      4. Save Multiple Analyses with New Window
    10. Scripting Graph Builder
  10. Chapter 7 Communicating with Users
    1. Introduction
    2. Introduction to Dialogs
      1. Modal Versus Non-Modal Dialogs
      2. Format of a JMP Dialog Window
      3. Format of a Custom Dialog
    3. Messages
      1. Modal Dialog Window Basics
      2. Know Your Options
    4. The Function Column Dialog( )
    5. Modal Column Dialog Using New Window
    6. Retrieve User Input
    7. Non-Modal Dialogs and Interactive Displays
    8. Interactive Displays
    9. Design a Platform Window
      1. Dialog Building Exercise—Know Your Tools
    10. Deploy User Input
      1. Put It All Together
      2. Concerns and Considerations
      3. Code Structure
  11. Chapter 8 Custom Displays
    1. Introduction
    2. Build a Custom Multivariable Display
      1. Build a Display from the Bottom Up
      2. JMP Platform( ) Function
      3. Custom By-Group Analysis without Platform
    3. Add Scripts to Graphs
    4. More Graph Customizations
    5. Interactive Graphs
      1. Handle and Mousetrap
      2. Drag Functions
  12. Chapter 9 Writing Flexible Code
    1. Introduction
    2. Code for the Task
      1. Compatibility
      2. Extensibility
      3. Maintainability
      4. Modularity
      5. Packaging
      6. Reusability
      7. Robustness
      8. Security
      9. Usability
    3. Capture Errors
      1. Anticipate Input Errors—What If?
      2. Exception Handling with Try and Throw Functions
    4. Use Namespaces
      1. Namespaces Are Global
      2. Expressions in Namespaces
    5. Deploy JMP Scripts
      1. Attach and Run Scripts from a Data Table
      2. JMP Add-Ins
      3. Menus and Toolbars
    6. JSL Functions
    7. Parse Strings and Expressions
      1. Character Functions
      2. Retrieve Stored Expressions
    8. Pattern Matching and Regular Expressions
      1. Regular Expressions
      2. Pattern Matching
    9. Use Expressions and Text as Macros
      1. FrameBox Customize: Value Versus Reference
      2. Substitute Versus Substitute Into
      3. Text Versus Expression Macros
    10. Functions: Pass By Reference Versus Value
      1. Function Versus Expression
      2. Pass By Value
      3. Pass By Reference
      4. Return More Than One Value
    11. Call SAS, MATLAB, and R from JSL
      1. Call R
    12. Call Other Programs from JSL
      1. Load DLL
      2. Run Program
  13. Chapter 10 Building Applications
    1. Introduction
    2. Converting a Script to an Add-In
      1. Add-In Builder
    3. Application Builder Basics
      1. Introduction – The Control Panel
      2. Application Builder Menu
      3. The Application Builder Script
    4. Building a Custom Application
  14. Chapter 11 Helpful Tips
    1. Introduction
    2. Lay Out Your Code
    3. Learn from Your Mistakes
      1. Format
      2. Syntax
      3. Programming
      4. Error Checking
    4. Debug Your Scripts
      1. Some Tips
      2. JMP Debugger
    5. Performance
      1. Some Tips
      2. Test Performance
      3. Pass By Reference Versus Pass By Value in Functions
  15. List of Scripts
  16. Index

Product information

  • Title: JSL Companion
  • Author(s): Theresa Utlaut, Georgia Morgan, Kevin Anderson
  • Release date: April 2018
  • Publisher(s): SAS Institute
  • ISBN: 9781635266115