CREATE VARIABLE
From SQL PL Guide for DB2
CREATE VARIABLE statement
Global variables are supported by DB2 since Version 9.5. They're improving data sharing between different SQL statements which are running in the same session (or connection). Global variables are a new object in DB2 an will stored in the catalog view SYSCAT.VARIABLES. They have to create with the CREATE VARIABLE statement. There're multiple possibilities to set and change the values of the variables.
Syntax:
CREATE VARIABLE <varschema>.<varname> <datatype> [DEFAULT <value>]
Example:
create variable GLOBAL.MYVAR INTEGER default 1