The ISDEFINED() built-in functions returns true if the SQL iQuery Script Session Variable exists. If the variable exists, this function returns true regardless of whether the variable contains any data.
The ISDEFINED() built-in function returns true if the iQuery Script Session Variable exists for this script. If the variable exists and is empty it returns true. If the variable exists and contains a value it returns true. If the variable was never
defined, it returns false.
#default &Company = 01
#define ® = ''
if defined(®);
#h2 Region &Reg
endif;
if NOT defined(&Company);
#msg Company is undefined
endif;
select * from foo;
The two Session Variables &COMPANY and ® are declared. &COMPANY is initialized to 01, while ® is empty. The IF DEFINED(®) returns true because ® is defined although it contains no value. The IF NOT DEFINED(&COMPANY) will return false because &COMPANY was initialized to 01.