Caché MultiValue Query Language (CMQL) Reference
CMQL Query Logging
Go to:

Creating a log of CMQL queries.
You can create a log of executed CMQL queries. CMQL logging is intended as a diagnostic aid for use when porting MultiValue queries. It should not be used as part of a production application.
The CMQL query log is created by writing subscript entries to the Caché global ^CMQLlog. This log is activated by setting ^CMQLlog = 1 and deactivated by setting ^CMQLlog = 0. Note that global names are case sensitive.
The operations that are listed in the CMQL log are invocations of CMQL commands, regardless of whether the command completes successfully.
Activating CMQL Logging from Caché MultiValue
To activate CMQL logging from the Caché MultiValue Shell, use the COS, #, or [ commands, which permit you to issue a Caché ObjectScript command from within MultiValue:
For further details on these commands, refer to the Caché MultiValue Commands Reference.
Setting ^CMQLlog=1 activates the logging of queries for the current account (namespace). All CMQL queries are logged, including queries that fail to execute due to an error. This logging remains in effect for all users of the current account (namespace) until ^CMQLlog is explicitly reset to 0 or the global is KILLed. CMQL logging persists across Caché restart.
Setting ^CMQLlog=0 deactivates the logging of queries for the current account (namespace). This means that queries issued when ^CMQLlog is set to zero are not logged in ^CMQLlog. Setting ^CMQLlog=0 does not delete the existing contents of ^CMQLlog. Queries that have been logged in ^CMQLlog remain listed in the log until you issue a KILL ^CMQLlog command. Setting ^CMQLlog=0 also does not suspend CMQL routine numbering. Caché MultiValue assigns a sequential integer routine number to every CMQL query issued, whether or not that CMQL query is logged. Issuing a KILL ^CMQLlog does not reset this CMQL routine number counter.
Viewing the CMQL Log
You can use the Caché ObjectScript ZWRITE command to view the CMQL query log. The following example displays ^CMQLlog from within the MultiValue Shell:
^CMQLlog(66,1)="LIST VOC WITH @ID LIKE Q..."
^CMQLlog(67,1)="SELECT VOC TO 4"
The first line returned shows the activation status of ^CMQLlog. In this case, CMQL logging is active for the USER account.
Each query in the CMQL log is represented by four lines. The first ^CMQLlog subscript is the CMQL routine number counter (in this case, routines 66 and 67). The second ^CMQLlog subscript is the log line number (1 through 4) for that query.