A REXX block contains a piece of REXX code for dynamic script manipulation. This piece of code is assigned a name in order to reference (call) it later on as part of other blocks.

WarpIN REXX support was added to allow for dynamic scripts. To support this, you must define a REXX block (and give it a function name) and call that function from some other part of the script which is supposed to be dynamic. The script part which called the function will then be dynamically be replaced with the return value of the REXX function. See "REXX Support Reference" for an introduction to WarpIN's REXX support.

This can only be specified at the root level in the script, i.e. in the WARPIN block.

Syntax:

<REXX NAME="functionname">
<![CDATA[
    rexx code
]]>
</REXX>
with:
NAME="functionname"
Required. The name of the REXX function, which must be unique in the WarpIN script. This must be used to call the REXX function from another part of the script. See "REXX Introduction" for more information.
rexx code
This can be any standard REXX code.

This must be enclosed in an additional <![CDATA[ ... ]]> block, which is XML-speak for a block of text which should not be parsed for markup. This is needed because otherwise angle brackets (especially "less than" and "greater than" comparisons in REXX code) would be interpreted as XML elements.

In the rexx code, you can make use of external libraries (e.g. load REXXUTIL), separate several commands within one line using a semicolon (";", but not needing this separator at line ends), or continue commands on the next line with the line continuation comma (",").

Besides, WarpIN exports a number of built-in REXX functions that may be called from within any REXX code without loading them first. See "Exported REXX functions" for details.

Function parameters can be evaluated with the regular parse function. See "REXX Examples" about how to pass parameters.

A value may be returned. This replaces the piece of dynamic XML code which called the function. See "REXX Introduction" for more information.

Example:

<REXX NAME="MyREXXCode">
<![CDATA[
  rc=rxFuncAdd('SysLoadFuncs',,
               'REXXUTIL','SysLoadFuncs'); rc=SysLoadFuncs();
  parse arg parameter . /* comments may be placed in the code */
  result='ABC'||parameter||'XYZ'
  return result
]]>
</REXX>