![]() Previous |
![]() Next |
Like most programming languages, the OLAP DML has several statements that you can use to determine the flow-of-control within a program. However, you must code explicit loops less frequently in an OLAP DML program because of the intrinsic looping nature of many OLAP DML statements.
Table: Statements For Determining Flow-of-Control lists OLAP DML flow-of-control statements. The looping characteristic of OLAP DML statements is discussed in "OLAP DML Statements Apply to All of the Values of a Data Object".
The OLAP DML contains the flow-of-control statements typically found in a programming language. Table: Statements For Determining Flow-of-Control lists these statements.
Statements For Determining Flow-of-Control
Statement | Description |
---|---|
|
Transfers program control from within a SWITCH, FOR, or WHILE statement to the statement immediately following the DOEND associated with SWITCH, FOR, or WHILE. |
|
Transfers program control to the end of a FOR or WHILE loop (just before the DO/DOEND statement), allowing the loop to repeat. You can use CONTINUE only within programs and only with FOR or WHILE. |
|
Brackets a group of one or more statements. DO and DOEND are normally used to bracket a group of statements that are to be executed under a condition specified by an IF statement, a group of statements in a repeating loop introduced by FOR or WHILE, or the CASE labels for a SWITCH statement. |
|
Specifies one or more dimensions whose status controls the repetition of one or more statements. |
|
Alters the sequence of statement execution within the program by indicating the next program statement to execute. |
|
Executes one or more statements in a program if a specified condition is met. Optionally, it also executes an alternative statement or group of statements when the condition is not met. |
|
An option that determines whether you can limit the dimension you are looping over within an explicit FOR loop. |
|
Terminates execution of a program before its last line. You can optionally specify a value that the program returns. |
|
Produces an error message and halts normal execution of the program. When the program contains an active trap label, execution branches to the label. Without a trap label, execution of the program terminates and, if the program was called by another program, execution control returns to the calling program. |
|
Provides a multipath branch in a program. The specific path taken during program execution depends on the value of the control expression that is specified with SWITCH. |
|
Limits the dimension you are looping over, inside a FOR loop or inside a loop that is generated by a REPORT statement. Status is restored after the statement following TEMPSTAT. If a DO ... DOEND phrase follows TEMPSTAT, status is restored when the matched DOEND or a BREAK or GOTO statement is encountered. |
|
Causes program execution to branch to a label when an error occurs in a program or when the user interrupts the program. When execution branches to the trap label, that label is deactivated. |
|
Repeatedly executes a statement while the value of a Boolean expression remains TRUE. |