CC:Substitution variables

From Remain Software
Jump to navigation Jump to search

Back.gif

Substitution variables

Substitution variables can be used in action definitions. When an action is executed, the substitution variables are replaced by their current actual values. Note however that some variables have no meaning when an action is applied statically, i.e. not during an object transfer process. For example, the variable &FROL (From object library) is not defined when an action is executed by using the option Apply in the function Object Maintenance.

Substitution variables can be entered in lower case or in upper case, but we advise to use upper case whenever possible.

Below follows a list of all the substitution variables that can be used in action definitions. Some of the variables have synonyms. These are listed in the Synonym column.

Variable Description Synonym
&JOBN Job number
&TFRC Transfer code
&TSBN Transfer subnumber
&APPC Application code
&REQN Request number &ERRN
&RLSN Release
&FIXN Fix number
&OBJC Object code
&OBJT Object type
&OBJA Object attribute
&MBRC Member code &DTLC
&DTLC Member code &MBRC
&OCLS Object class
&EXCI May not exist indicator &TOVI
&TOVI May not exist indicator &EXCI
&OVRC Override code
&SOLT Solution type
&SRTC Sort code
&OPTI ’M’=Move ’C’=Copy
&SRCP Source Processing
&FRPL From production level &FENV
&FENV From production level &FRPL
&FROL From object library
&FSRL From source library
&FSRF From source file
&FSRM From source member
&TOPL To production level &TENV
&TENV To production level &TOPL
&SEQN To librarylist sequence &LSQN
&LBLT To librarylist type
&FLBI To libl fallback
&QTPI To libl quit process
&TOOL To object library
&SRCL To source library &TSRL
&TSRL To source library &SRCL
&SRCF To source file &TSRF
&TSRF To source file &SRCF
&SRCM To source member &TSRM
&TSRM To source member &SRCM
&MBRA Source member attribute
&ROTC Route code
&ELBC Extended part of directory code
&CNVT Data conversion type
&CNVS Data conversion scope
&PGMN Conversion program name &CPGM
&CPGM Conversion program name &PGMN
&PGML Conversion program library &CPGL
&CPGL Conversion program library &PGML
&ROBC Related object code &CROB
&CROB Related object code &ROBC
&CATT Attribute conversion type
&CATS Attribute conv. scope
&CAUT Authorisation conv. type
&CAUS Authorisation conv. scope
&CJOT Journal conversion type
&CJOS Journal conversion scope
&SRCS Sources belong to object
&SRCX Source Change date
&OBJX Object Source change date
&CHGX Object Change date
&VRSB Based-on version
&MODB Based-on modification
&VRSN New version
&MODN New modification
&OBJR Replaced object ind
&VRSR Replaced version
&MODR Replaced modific.
&FIXR Replaced Fixnumber
&ACTO Actions output
&STAT Status

Back.gif

Substitution-variables for the definition of Actions on IFS-objects

During the execution of an Action, the following variables are available for manipulating IFS-objects:

&IOBC IFS-object
&FDIR From directory
&TDIR To directory
&FPTH From path; &FDIR and &IOBC concatenated
&TPTH To path; &TDIR and &IOBC concatenated
&PTHX Extended part of recursive Route directory
&IOBQ IFS-object enclosed by quotes
&FDIQ From directory enclosed by quotes
&TDIQ To directory enclosed by quotes
&FPTQ From path enclosed by quotes
&TPTQ To path enclosed by quotes
&PTXQ Extendend part of Route dir. enclosed by quotes
&IOBL Length of IFS-object (&IOBC)
&FDIL Length of From directory (&FDIR)
&TDIL Length of To directory (&TDIR)
&FPTL Length of From path (&FPTH)
&TPTL Length of To path (&TPTH)
&PTXL Length of extended part of Route directory (&PTHX)
&IOBN IFS-object name without file.type-extension
&IOBA IFS-file.type-extension without the dot
&TIOL To library of object that may be build from IFS source file

The following variables have a different value for IFS-objects, but are not empty:

&OBJC Short name of &IOBC
&FROL Reference pointer to &FDIR
&TOOL Reference pointer to &TDIR

In the following example file HELP.EXE moves from directory /DEV/BIN/ to directory /TEST/BIN/. The substitution-variables have the following values at Processing Step SO (Start of Object):

&IOBC HELP.EXE
&FDIR /DEV/BIN/
&TDIR /TEST/BIN/
&FPTH /DEV/BIN/HELP.EXE
&TPTH /TEST/BIN/HELP.EXE
&IOBL 8
&FDIL 9
&TDIL 10
&FPTL 17
&TPTL 18

For library-objects (Object Class ’0’ (zero)) the IFS-variables have names that correspond to the filesystem QSYS.LIB:

&IOBC CUSTOMER.FILE
&FDIR /QSYS.LIB/HELPITDEV.LIB/
&TDIR /QSYS.LIB/HELPITTST.LIB/
&FPTH /QSYS.LIB/HELPITDEV.LIB/CUSTOMER.FILE
&TPTH /QSYS.LIB/HELPITTST.LIB/CUSTOMERFILE
&IOBL 13
&FDIL 24
&TDIL 24
&FPTL 37
&TPTL 37

When the detailcode (&MBRC) is filled for file-members or messages, this detailcode is used in the variables &IOBC, &FPTH and &TPTH only for objects of type *FILE. The following table shows the values for the transfer of member RICHCLIENT in file CUSTOMER:

&IOBC CUSTOMER.FILE/RICHCLIENT.MBR
&FPTH /QSYS.LIB/HELPITDEV.LIB/CUSTOMER.FILE/ RICHCLIENT.MBR
&TPTH /QSYS.LIB/HELPITTST.LIB/CUSTOMER.FILE/ RICHCLIENT.MBR

In TD/OMS, a detail can also be a message in a message-file. A message is not an OS/400 object, so the message-id will never be part of variable &IOBC. However, &IOBC will contain the IFS-name of the message-file.

For length-fields ( &xxxL ) the following rules apply:

  • The length is always 5 digits, including trailing zeroes.
  • When a length-variable is passed to a program as in CALL PGM(A) PARM(&FDIL ... ), the variable must be declared as TYPE(*DEC) LEN(15 5) or the equivalent in a different language than CL.
  • Trailing blanks are truncated from all values of alphanumeric fields and are never counted in determining the length of the value.