Examples: Conditional breakpoint

These are examples of setting conditional breakpoints.

CL declarations:   DCL    VAR(&CHAR1) TYPE(*CHAR) LEN(1)
                   DCL    VAR(&CHAR2) TYPE(*CHAR) LEN(2)
                   DCL    VAR(&DEC1) TYPE(*DEC) LEN(3 1)
                   DCL    VAR(&DEC2) TYPE(*DEC) LEN(4 1)
 
 
Debug command:     BREAK 31 WHEN &DEC1 = 48.1
 
Debug command:     BREAK 31 WHEN &DEC2 > &DEC1
 
Debug command:     BREAK 31 WHEN &CHAR2 <> 'A'
 
Comment:           'A' is implicitly padded to
                   the right with one blank character before
                   the comparison is made.
 
 
Debug command:     BREAK 31 WHEN %SUBSTR(&CHAR2 2 1) 
<= X'F1'
 
Debug command:     BREAK 31 WHEN %SUBSTR(&CHAR2 1 1) 
>= &CHAR1
 
Debug command:     BREAK 31 WHEN %SUBSTR(&CHAR2 1 1) 
< %SUBSTR(&CHAR2 2 1)

The %SUBSTR built-in function allows you to substring a character string variable. The first argument must be a string identifier, the second argument is the starting position, and the third argument is the number of single byte or double byte characters. Arguments are delimited by one or more spaces.