Predefined (built-in) variables

Discussion created by Michael_Lowry on May 12, 2017
Predefined variables are read-only variables that can be used in any executable object. They resemble object variables, but include a dollar sign ($) after the ampersand (&). They take the form &$VARIABLE#, and provide information about the system or currently-executing task.

The List of Predefined Variables for System and Object Values in the v12.0 documentation does not list all predefined variables. The documentation has recently been updated to include more of them, but it is still incomplete. In the meantime, you can generate a complete list using the following SQL query.
where SVALU_ACTIVE = 1
order by SVALU_SVALF_FVName asc
The name of each variable usually gives a good indication of what it contains, and the context in which it is set. Below are some examples.

Predefined variableDescriptionContext
&$SQL_CAPTIONS#Show headlines in output (Y/N)
SQL jobs
&$SQL_COLUMN_SEPERATOR#Column separator in output
SQL jobs
&$SQL_MAX_CHARACTERS#Maximum number of characters in a column
SQL jobs
&$SQL_MAX_ROWS#Maximum number of rows returned
SQL jobs
&$SQL_REMOVE_CRLF#Remove line breaks (Y/N)
SQL jobs
&$SQL_SHOW_NULL#Show null as empty string (Y/N)
SQL jobs
&$SQL_SUBST_CHARACTER#Substitution character
SQL jobs
Include subdirectories(Y/N)File transfers
Transfer complete folder structure (Y/N)
File transfers
Use wildcards (Y/N)
File transfers
Obtain complete non-JES output (Y/N)
z/OS jobs
Message class(es) to obtain
z/OS jobs
Route message class(es) to
z/OS jobs