The PSL compiler contains an interface that recognizes classes, methods, and properties that appear in the following tables:
Object Class Library table (OBJECT)
Class Methods table (OBJECTMET)
Object Properties table (OBJECTPROP)
Data item documentation for these tables and their attributes appears in DATA-QWIK.
The following steps occur when compiling a PSL procedure.
When the compiler encounters a PSL method, it loads the definition from the OBJECTMET table.
The compiler then generates the M code associated with those methods and properties.
The compiler queries the database dictionary to identify table columns for which to process commands, and verifies M code syntax.
The compiler creates a run-time routine that can be called from a Profile function. The system stores the compiled M routine in your .CRTNS directory.
Specifying Compiler Options
The compilation process can be tailored using a number of compiler options. The options that are in effect during the compilation of a single PSL module are determined in the following precedence order (listed from highest to lowest):
Options specified explicitly in the module that is compiled. This applies to the #WARN, #OPTIMIZE, and #OPTION compiler commands.
Options specified for this invocation of the PSL compiler. Applicable options are specified in the commands(,) parameter of the call to the compiler.
Options specified in the UCOPTS override file as denoted by the environment variable SCAU_UCOPTS.
Options specified in UCOPTS. Each environment includes a routine UCOPTS. The PSL compiler invokes ^UCOPTS(.Options) to obtain the environment-specific options. The next section explains how to specify the environment specific defaults.
Compiler defaults. These values apply for all options that are not specified by any of the above options.
Defining the Environment Specific Settings for the PSL Compiler
The PSL compiler can be tailored to the needs and requirements of the environment in which it runs. Perform the following steps to modify these settings.
Every PSL distribution includes a file UCOPTS.ini. This file is copied to the environment's top level directory. The UCOPTS.ini that comes with the PSL distribution lists all settings that can be used to configure the PSL compiler and the recommended settings for typical environments.
Modify the UCOPTS.ini file to adjust the settings for the environment
At the GT.M direct mode prompt, enter:
DO bootUCOPTS^UCGMCU()
The call to bootUCOPTS^UCGMCU() generates a new version of routine UCOPTS, that is called for subsequent compilations.
The following settings can be specified in UCOPTS.ini:
#INFO Compiler command default settings
#OPTIMIZE Compiler command default settings
#OPTION Compiler command default settings
#WARN Compiler command default settings
PSL property values
The PSL compiler supports a number of properties that are environment specific. Some of these properties are immutable, for example, because they are derived from the GT.M version. Other values, however, can be modified to optimize the application's runtime behavior.
Each individual setting is explained in the standard UCOPTS.ini file.
Defining Process Specific Overrides for PSL Compiler Settings
The environment specific settings of UCOPS.ini, which have been compiled into routine UCOPTS, can be overridden for the GT.M process that calls the PSL compiler. To use this feature, perform the following steps:
Copy the standard UCOPTS.ini to a file with a different name (possibly in a different directory).
Modify that copy of UCOPTS.ini as needed for the override, and store the modified file.
Alternatively, you can create a file from scratch, and only specify the settings that you want to override explicitly.
Before invoking GT.M, set the environment variable SCAU_UCOPTS to the full pathname of the override file.
Invoke GT.M (either the direct mode, or the LABEL^ROUTINE that invokes the compiler).
You cannot override PSL property values through this mechanism, but you can override all #INFO, #OPTIMIZE, #OPTION, and #WARN settings.
Compiling a PSL Procedure
To compile a PSL procedure into an M routine, run the Build Run Time Routine function (DBSPROCB) to convert the PSL code in your procedure into the associated M code. You can specify a number of compiler commands (i.e., parameters) when running this function. After compiling, the following line appears along with most syntax and compilation errors (if any exist):
ZEXAMPLE - compile runtime routine ZEXAMPLE … 8:25 AM
For additional guidelines concerning PSL code compilation, refer to the following sections: