Statement Used Only in Programs


Table: Statements Used Only in OLAP DML Programs lists the OLAP DML statements that you can use only within the contents of an OLAP DML program.

Statements Used Only in OLAP DML Programs

Statement Description
ARG
Lets you reference arguments passed to a program by returning one argument as a text value.
ARGCOUNT
Returns the number of arguments that were specified when the current program was invoked.
ARGFR
Lets you reference the arguments that are passed to a program by returning a group of one or more arguments, beginning with the specified argument number, as a single text value.
ARGS
Lets you reference the arguments that are passed to a program by returning all the arguments as a single text value.
ARGUMENT
Declares an argument that is expected by a program.
BREAK
Transfers program control from within a SWITCH, FOR, or WHILE statement to the statement immediately following the DOEND associated with SWITCH, FOR, or WHILE.
CALLTYPE
Returns a value that Indicates whether a program was invoked as a function, as a command, or by using the CALL command.
CONTINUE
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.
DO ... DOENDs 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.
FOR
Specifies one or more dimensions whose status will control the repetition of one or more statements.
GOTO
Alters the sequence of statement execution within the program by indicating the next program statement to execute.
IF...THEN...ELSE
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.
RETURN
Terminates execution of a program prior to its last line. You can optionally specify a value that the program will return.
SIGNAL
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.
SWITCH
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.
TEMPSTAT
Limits the dimension you are looping over, inside a FOR loop or inside a loop that is generated by the REPORT command. 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.
TRAP
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.
VARIABLE
Declares a local variable or valueset for use within a program. A local variable cannot have any dimensions and exists only while the program is running.
WHILE
Repeatedly executes a statement while the value of a Boolean expression remains TRUE.
END
Marks the end of the program contents.