Chapter 7. Functions

Revision History
Revision V7.1-006 03 December 2024
Revision V7.1-005 18 September 2024
  • In “$ZCOnvert()”, Efficient $zconvert transform between WIN-1252 and UTF-8 or UTF-16

Revision V7.1-004 27 June 2024
Revision V7.1-003 23 November 2023
  • In “$ZPEEK()”, Revise the Note on selection among multiple replication journal pools

Revision V7.1-001 26 June 2023
Revision V7.1-000 04 April 2023
Revision V7.0-005 02 December 2022
Revision V7.0-004 20 September 2022
  • In “$ZSOCKET()”, add new $ZSOCKET() keywords for getsockopt() items. Disabled support for pre-TLSv1.2

Revision V7.0-003 24 June 2022
Revision V7.0-002 23 March 2022
Revision V7.0-001 24 November 2021
Revision V6.3-012 08 April 2020
Revision V6.3-010 31 October 2019
Revision V6.3-007 04 February 2019
Revision V6.3-006 26 October 2018
Revision V6.3-005 29 June 2018
Revision V6.3-004 23 March 2018
Revision V6.3-003 12 December 2017
Revision V6.3-001 20 March 2017
Revision V6.2-001 27 February 2015
  • Updated “$ZTRIgger()” for V6.2-001 multi-line XECUTE string enhancements, $ZTRIGGER() return status, specified that $ZTRIGGER() always operates within a TP transaction even if it needs to implicitly create one, and added a note on the support of triggers in spanning regions.

  • Added a new section called “$ZSOCKET()”.

  • In “$ZPEEK()”, specified that $ZPEEK() function generates an UNDEF error when VIEW UNDEF is not set and format parameter is specified but is undefined and added the JNL[REG]:region and JBF[REG]:region keyword first arguments.

  • In “Argument Keywords of $VIEW()”, added "RTNCHECKSUM" as a new ARG1.

Revision V6.1-000 28 August 2014
Revision V6.0-003 24 February 2014
Revision V6.0-001 21 March 2013

Table of Contents

$ASCII()
Examples of $ASCII()
$Char()
Examples of $CHAR()
$Data()
Examples of $DATA()
$Extract()
Examples of $EXTRACT()
$Find()
Examples of $FIND()
$FNumber()
Examples of $FNUMBER()
$Get()
Examples of $GET()
$Increment()
Examples of $INCREMENT()
$Justify()
Examples of $JUSTIFY()
$Length()
Examples of $LENGTH()
$NAme()
Examples of $NAME()
$Next()
$Order()
Examples of $ORDER()
$Piece()
Examples of $PIECE()
$Qlength()
Examples of $QLENGTH()
$QSubscript()
Examples of $QSUBSCRIPT()
$Query()
Examples of $QUERY()
$Random()
Examples of $RANDOM()
$REPLACE()
Examples of $REPLACE()
$REverse()
Examples of $REVERSE()
$Select()
Examples of $SELECT()
$STack()
Examples of $STACK()
$Text()
Examples of $TEXT()
$TRanslate()
Examples of $TRANSLATE()
$View()
Argument Keywords of $VIEW()
Examples of $VIEW()
$ZAHandle()
$ZAscii()
Examples of $ZASCII()
$ZATRansform
Examples of $ZATRANSFORM()
$ZAUditlog
Examples of $ZAUDitlog()
$ZBIT Functions
$ZBITAND()
$ZBITCOUNT()
$ZBITFIND()
$ZBITGET()
$ZBITLEN()
$ZBITNOT()
$ZBITOR()
$ZBITSET()
$ZBITSTR()
$ZBITXOR()
Examples of $ZBIT Functions
$ZCHar()
Example of $ZCHAR()
$ZCOLlate()
Example of $ZCOLlate()
$ZCOnvert()
Examples of $ZCONVERT()
$ZDATA()
Examples of $ZDATA()
$ZDate()
$ZDATE Format Specification Elements
Examples of $ZDATE()
$ZExtract()
Examples of $ZEXTRACT()
$ZFind()
Examples
$ZGetjpi()
Examples
$ZJOBEXAM()
Examples of $ZJOBEXAM()
$ZJustify()
Examples of $ZJUSTIFY()
$ZLength()
Examples of $ZLength()
$ZMessage()
Examples of $ZMESSAGE()
$ZPARSE()
Examples of $ZPARSE()
$ZPIece()
Examples of $ZPIECE()
$ZPEEK()
$ZPrevious()
$ZREPLACE()
Examples of $ZREPLACE()
$ZSOCKET()
$ZSYSLOG()
$ZQGBLMOD()
$ZSEARCH()
Examples of $ZSEARCH()
$ZSIGPROC()
Examples of $ZSIGPROC()
$ZSUBstr()
Examples of $ZSUBSTR()
$ZTRanslate()
Examples of $ZTRANSLATE()
$ZTRIgger()
Examples of $ZTRIGGER()
$ZTRNLNM()
Examples of $ZTRNLNM()
$ZWidth()
Examples of $ZWIDTH()
$ZWRite()

This chapter describes M language Intrinsic Functions implemented in GT.M. Traditional string processing functions have parallel functions that start with the letter "z". The parallel functions extend the byte-oriented functionality of their counterparts to UTF-8 mode. They are helpful when applications need to process binary data including blobs, binary byte streams, bit-masks, and so on.

Other functions that start with the letter "z" and do not have counterparts implement new functionality and are GT.M additions to the ANSI standard Intrinsic Functions. The M standard specifies standard abbreviations for Intrinsic Functions and rejects any non-standard abbreviations.

M Intrinsic Functions start with a single dollar sign ($) and have one or more arguments enclosed in parentheses () and separated by commas (,). These functions provide expression results by performing actions that are impossible or difficult to perform using M commands.