IBM InfoSphere DataStage, Version 11.3.1
CLEAR statement
Syntax
CLEAR [COMMON]
Description
Use the CLEAR statement at the beginning of a program to set all assigned and unassigned values of variables outside of the common area of the program to 0. This procedure avoids run-time errors for unassigned variables. If you use the CLEAR statement later in the program, any values assigned to non-common variables (including arrays) are lost.
Use the COMMON option to reset the values of all the variables in the unnamed common area to 0. Variables outside the common area or in the named common area are unaffected.
Example
A=100
PRINT "The value of A before the CLEAR statement:"
PRINT A
CLEAR
PRINT "The value of A after the CLEAR statement:"
PRINT A
PRINT
*
COMMON B,C,D
D="HI"
PRINT "The values of B, C, and D"
PRINT B,C,D
CLEAR COMMON
PRINT B,C,D
This is the program output:
The value of A before the CLEAR statement: 100
The value of A after the CLEAR statement: 0
The values of B, C, and D
0 0 HI
0 0 0
Last updated: 2015-03-09
PDF version of this information: