Previous Topic: Example: Function

Next Topic: How IMODs Are Created

Example: ADDRESS Environment

You can install ADDRESS environments in the IBM‑prescribed manner. However, the CAW0JCL(BYSADDA) data set member is provided for you to create a sample ADDRESS environment that can be used under TSO/E REXX and CA‑GSS. When assembled and link edited, this member is a TSO/E REXX function that dynamically adds an ADDRESS environment to TSO/E REXX:

address subcom 'sampaddr'  /* test for existence of environment */
if rc ^= 0 then do
   rslt = addaddr('BYSSADD','BYSSADD')     /* add environment */
   say 'addaddr returns' rslt
   end

When executed, the ADDRESS environment takes the following actions:

You can use the following REXX exec to check the operation of the BYSSADD ADDRESS environment:

queue 'stack_record_1'
queue 'stack_record_2'
queue 'stack_record_3'
address BYSSADD 'command_string'
say 'rc variable:' rc
say "sample" variable:' sample