PERFORM statement

Syntax

PERFORM command

Description

Use the PERFORM statement to execute an InfoSphere® DataStage® sentence, paragraph, menu, or command from within the BASIC program, then return execution to the statement following the PERFORM statement. The commands are executed in the same environment as the BASIC program that called them; that is, unnamed common variables, @variables, and in-line prompts retain their values, and select lists and the DATA stack remain active. If these values change, the new values are passed back to the calling program.

You can specify multiple commands in the PERFORM statement in the same way you specify them in the body of an InfoSphere DataStage paragraph. Each command or line must be separated by a field mark (ASCII CHAR(254)).

If command evaluates to the null value, the PERFORM statement fails and the program terminates with a run-time error message.

You cannot use the PERFORM statement within a transaction to execute most InfoSphere DataStage commands and SQL statements. However, you can use PERFORM to execute the following InfoSphere DataStageInfoSphere DataStage commands and SQL statements within a transaction:

CHECK.SUM INSERT SEARCH SSELECT COUNT LIST SELECT (RetrieVe) STAT DELETE (SQL) LIST.ITEM SELECT (SQL) SUM DISPLAY LIST.LABEL SORT UPDATE ESEARCH RUN SORT.ITEM GET.LIST SAVE.LIST SORT.LABEL

REALITY Flavor

In a REALITY flavor account PERFORM can take all the clauses of the EXECUTE statement. To get these PERFORM characteristics in other flavor accounts, use the PERF.EQ.EXEC option of the $OPTIONS statement.

Example

In the following example multiple commands are separated by field marks:

PERFORM 'RUN BP SUB'
FM=CHAR(254)
COMMAND = 'SSELECT EM':FM
COMMAND := 'RUN BP PAY':FM
COMMAND := 'DATA 01/10/85'
PERFORM COMMAND
A = 'SORT EM '
A := 'WITH PAY.CODE EQ'
A := '10 AND WITH DEPT'
A := 'EQ 45'
PERFORM A