To begin to understand how JMP Life Sciences processes operate, let's peruse the SAS code associated with the Column Contents process. This code is contained in the DataContents.sas file located in the ProcessLibrary folder of your JMP installation directory.
Navigate to the DataContents.sas file.Typically, when JMP Genomics is loaded on a Windows machine, the default path to this file is C:\Program Files\SASHome\JMP\10\Genomics\ProcessLibrary\ .
Open the DataContents.sas file with a text editing program./ *%global InData Print ColumnSubset NumVars OutPath MacroPath DataContents_Frame DataContents_Body%macro DataContents;%let ProcessName = DataContents;%let InData = &TmpName;% PrepHTML ( datacontents_body, datacontents_frame, datacontents_contents,&OrigInData._Body.html,&OrigInData._Frame.html,&OrigInData._Contents.html ) ;proc contents data =&InData;% exit:;%mend DataContents;% DataContentsThe SAS code for a JMP Life Sciences process contains these primary sections:
•
• JSL File Generation (optional)Each section makes extensive use of SAS macro variables to enable flexibility and reuse. JMP Life Sciences software resolves all of these variables at run time to create an executable SAS program. The software then submits this code using SAS in batch mode. Output in this case is an .html file, which is automatically launched. Details on each of the coding sections are as follows:The Preamble is the introductory section of the code and can be used to keep track of change dates, special instructions, or whatever other preliminary information you want to include. It should be enclosed in a standard SAS comment block, /* */ .Each process contains a set of process variables, which are the input parameters to be set before running the routine. JMP Life Sciences software automatically generates an input dialog box for each of these parameters according to a format that you specify in an associated .xml file (see JMP Life Sciences XML Tags, Attributes, and Values ). You have the ability to modify, save, and load your own settings for these variables each time you invoke the process.The Column Contents process has nine process variables: InData , Print , ColumnSubset , NumVars , OutPath , MacroPath , DataContents_Frame , DataContents_Body , and DataContents_Contents.
•
• Define each variable with a unique name in a %global statement. These names correspond to SAS macro variables that are to be automatically assigned values specified by the user of the process.
• Always specify the MacroPath process variable in your list. This variable contains the location of the folder containing SAS macro files that are %include 'd in subsequent statements.
• Conclude the process variable definitions section by typing the following SAS comment, with no spaces: *ProcessBody; .The initialization section immediately follows the *ProcessBody; statement and is used to define your primary SAS macro block and to perform various tasks that are necessary for process execution. The initialization section should begin with a %macro statement and then contain one or more of these statements:
• %include statements to retrieve macros or SAS code that is defined in other files
• %let statements to define macro variables not surfaced to the userFor Column Contents , the initialization section begins by starting a macro called DataContents and by defining the macro variable ProcessName with the same value. This convention enables you to reference the process name in subsequent utility routines provided with the system.Note : The %DataContents macro and the primary macros for other processes have no direct functional arguments. All of the input values are defined previously as macro variables using the %global statement. If you prefer to use argument-style macros, you can %include their definition files and then assign their arguments appropriately.The file UtilityMacros.sas contains a collection of macros that are provided with the system. You should always %include this file near the beginning of your code. You can find this file and others in your JMP installation folder.
Navigate to the location of the UtilityMacros.sas file.Typically, when JMP Genomics is loaded on a Windows desktop machine, the default path to this file is C:\Program Files\SASHome\JMP\10\Genomics\MacroLib\ .
Open the UtilityMacros.sas file with a text editing program.
Examine the contents of the UtilityMacros.sas file.In addition to providing the definitions for numerous macros, the UtilityMacros.sas file provides some code (located near the end of the file) that is executed to initialize the process.
1 The %GetOrigFileNamelock macro obtains the original filename of the specified data set and assigns it to the macro variable OrigFileName .
2 The %PathName utility macro parses the InData variable so that you can create a SAS LIBNAME and MEMNAME from it.Whenever possible, you should provide error checking code to help diagnose and troubleshoot unintended results. Use the exiterror macro variable and the SAS syserr macro variable as flags for this, and the %exit: macro label at the end of the code to provide an exit point when an error condition is set or detected.This section is the heart of the process. It is here that you use all of the previously-defined macros and macro variables to perform the principal operations of the code. You can make this section as simple or as complex as you want. You have the full power of SAS at your disposal, and you can invoke any of the SAS procedures that are available on your machine. You can even use the %LaunchExternalProgram macro to run executables from other languages.For Column Contents , this section performs five basic tasks:
1 It prepares three .html files and executes an ODS statement that sets up these files for capturing subsequent output in .html .
2 It creates a subset of the data for the case when the Use a Subset of Columns option is checked.
5 It executes a second ODS statement to close the .html file generation.The Column Contents process does not generate a JMP script.See Creating a JSL File for Dynamic Graphics and Analyses for a detailed discussion of JSL file generation.In the packaging section, all of the components of the process that you want to return to the user are bundled together. Package contents can include SAS data sets, SAS output in various forms like text, .html or .pdf , and .jsl files. You create the package by invoking one or more utility macros. This process calls the %PackageInsertHtml macro and inserts the three .html files into the package. Other packaging macros available, but not used here, include %PackageInsertDataset for SAS data sets and %PackageInsertFile for text files.This is the final section of the process and includes all statements that are necessary for successful termination of the macro. The Column Contents process concludes as follows:
1 The %exit: macro label is the argument for prior %goto statements called whenever there is an error.
2 The first %if statement checks the error flags and prints a message to the log if they are nonzero.
3 The %ExitSDSProcess macro concludes packaging, prints error messages, and calls the %ClockStop macro to print the execution time to the log.
4 The %mend statement concludes the macro definition and the %DataContents statement runs the macro.