Expressions, operator commands, messages, rule records, and SMF records can use
symbolic fields. Symbolic fields usually start with the ampersand
(&) character, the only exception being an expression.
&JOBN can be used to specify &JOBNAME. &) is optional on the left side of an expression.SY-0286-DJT: IF &ACCT = SY-0286-DJT
IF ACCT = SY-0286-DJT
When evaluating an expression, symbolic substitution will be performed before evaluating
the expression. This facility allows symbolic fields to be placed on both sides of the
relational operator. In the following example, the expression will compare the
OWNERID for a VSAM file with the current job name.
IF &OWNER NE &JOBNAME
The DEFCMD, DEFMSG, DEFREC, and
DEFSMF statements can use symbolic fields to build operator commands,
messages, rule records, and SMF records. For example, the following message will perform
symbolic substitution for the current job name:
DEFMSG WRNMSG01 “** WARNING ** &JOBNAME INVALID”
When just part of a symbolic field is required, the displacement and length of the substring can be specified with the symbolic name. The displacement and length should be enclosed in parentheses and separated by a comma or blank. The parenthetical field must be concatenated with the symbolic field name, and cannot be separated with blanks. Do not insert blanks between the symbolic field name and the parenthetical substring specification. For example, the following symbolic name will be evaluated for the first three characters of the job name:
&JOBNAME(1,3)