JSL FILE MANAGER BRADY BRADY AND DON MCCORMACK, JMP C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MOTIVATION WHY BUILD THIS THING? Most file management relies on organizing work in operating system directories. This approach is suboptimal because: • Over time, directory organization may grow unpredictably making it difficult to change, rename, move, merge, or split directories. • Deeply nested directories make it difficult to know what’s in them. • All you may know is the file name and type unless you open the file (e.g., very little metadata is available). • Cross-referencing is typically achieved by keeping multiple copies or by using alias. Neither of these methods works well • • What’s the most recent copy? Where are they all? Aliases break when the original file is moved (PC) or can be as much as 100X larger than the original file (Mac). C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MOTIVATION THE SOLUTION Create a JSL Add-In that: • Works for multiple file types. • Is easy to maintain. • Displays important metadata for any file through an interactive searchable interface. • Lets the user add/change metadata and add files. • Requires a minimal amount of user set-up. C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FILE METADATA “VIEW” TAB SELECTED File parameters, scanned in from files: - Number of rows, columns, scripts, etc. - Scripts - Scripted platforms - Path Controlled, “fixed-vocabulary” fields: - Changed via cascading drop-downs Free text fields: - Changed via text edit boxes C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FILE METADATA “EDIT” TAB SELECTED File parameters, scanned in from files: - Number of rows, columns, scripts, etc. - Scripts - Scripted platforms - Path Free text fields: - Changed via text edit boxes Controlled, “fixed-vocabulary” fields: - Changed via cascading drop-downs C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . AUTORUN DISABLING “ON OPEN” SCRIPTS IN DATATABLES AVOIDANCE • Get current preference, then set to suppress “On Open” scripts in datatables: • Use << On Close () to restore original preference when main window closes: C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . AUTORUN CIRCUMVENTING “//!” IN .JSL FILES AVOIDANCE • Displaying scripts: use Load Text File ( ) + put into Script Box: C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . AUTORUN CIRCUMVENTING “//!” IN .JSL FILES AVOIDANCE • Updating Metadata: if present, leave !// at top: C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FILE METADATA LOADING / SAVING • Changes are written directly to the File Properties data table and the file itself; no need for a subsequent re-scans unless data is changed. • Source file (.jmp, .jrn or .jsl) is opened as hidden, then modified with new metadata entries and saved off. • Data tables use a table variable • Journal uses a textbox within a hidden outline box • Scripts use a commented section C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FILE METADATA LOADING / SAVING For each metadata property (i.e., Industry, Topics, etc.): • • Property name is between <<NameBeg>> and <<NameEnd>> delimiters Property value is between <<TextBeg>> and <<TextEnd>> delimiters C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FILE METADATA LOADING / SAVING C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FINDING SCRIPTS TEXT TOOLS USED WITHIN FILES Character functions • Contains ( ) • Char ( ) • Insert Into ( ) • Length ( ) • Substitute ( ) / Substitute Into ( ) • Substr ( ) • Uppercase ( ) Journal Messages • jrn << Get Journal Data Table Messages • dt << get Table Script Name ( ) • dt << get Table Property ( ) C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FINDING SCRIPTS WITHIN FILES • Within a datatable, scripts are stored as table properties. • Within a journal, scripts reside in Button Boxes. C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . FINDING PLATFORMS WITHIN SCRIPTS • Fit Model and DOE require special processing C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . PLATFORMS / PERSONALITIES FIT MODEL PERSONALITIES AND DOE PLATFORMS C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . SUMMARIZING MULTIPLE RESPONSES Goal: extend Summary platform functionality to work with Multiple Responses. C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . SUMMARIZING MULTIPLE (BEFORE) RESPONSES C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . SUMMARIZING MULTIPLE (AFTER) RESPONSES C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . COMPLEX ROW SELECTION • You can use a Local Data Filter, with or without an associated platform, to avoid querying with complicated WHERE clauses: C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . USING HIDDEN OUTPUT C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . USING HIDDEN OUTPUT C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MODIFYING THE CURRENT ROW SELECTION When you construct a WHERE clause interactively, the Select Rows dialog gives 3 options for dealing with currently selected rows: • Clear them (Start over) • Extend from them (logical OR) • Select from them (logical AND) JSL will not support these options until V12. C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MODIFYING THE CURRENT ROW SELECTION You can achieve the same results by combining row selection messages in various ways: << Select Where ( logical expression ) • Clears present selection, then selects rows meeting the condition. << Get Rows Where ( logical expression ) • Returns a vector of the row numbers of the rows meeting the condition. << Clear Select • Deselects all rows. << Select Rows ( vector of row numbers ) • Selects rows whose row numbers the vector contains, without clearing the present selection. C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MODIFYING THE CURRENT ROW JSL EQUIVALENTS FOR THE ‘SELECT’ DIALOG’S OPTIONS SELECTION C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MANIPULATING JOURNALS Use display tree messages to: Messages used: • Close and de-select all outline boxes • Highlight desired button boxes and open ancestors C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . << select << deselect << top parent << close << get button name << parent << class name MANIPULATING “ZIPPING UP” A JOURNAL JOURNALS C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MANIPULATING FINDING AND SURFACING BURIED SCRIPTS JOURNALS First, select all buttons containing the desired scripts: C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . MANIPULATING FINDING AND SURFACING BURIED SCRIPTS JOURNALS Next, move up parent by parent, opening each, until you reach the top: C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . CASCADING MENUS • Data table houses the hierarchy • Built using a series of associative arrays: - Read 2 columns from a table - The first holds choices for one drop-down menu - The second holds choices for its “child” menu - When a selection is made, update any descendant drop-downs C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d . CASCADING MENUS TOOLS USED • Associative Arrays • Associative Array ( ) • << get values • << get keys • Data table messages • dt << select where • dt << get rows where • column << set selected • Display box messages • ComboBox << get • ComboBox << set items • TextBox << set text C op yr i g h t © 2 0 1 2 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .
© Copyright 2026 Paperzz