As described in previous topics, many language processor environments can be initialized in one address space.A language processor environment is associated with an MVS task. There can be several language processor environments associated with a single task. This topic describes how non-reentrant environments are chained together in an address space.
Language processor environments are chained together in a hierarchical structure to form a chain of environments. The environments on one chain are interrelated and share system resources.For example, several language processor environments can share the same data stack. However, separate chains within a single address space are independent.
Although many language processor environments can be associated with a single MVS task, each individual environment is associated with only one task. Figure below illustrates three language processor environments that form one chain.
Three Language Processor Environments in a Chain
The first environment initialized was environment 1. When IRXINIT initializes the second environment, the first environment is considered to be the previous environment (the parent environment). Environment 2 is chained to environment 1. Similarly, when IRXINIT initializes the third environment, environment 2 is considered to be the previous environment. Environment 2 is the parent environment for environment 3.
Different chains can exist in one address space.illustrates two separate tasks, task 1 and task 2. Each task has a chain of environments. For task 1, the chain consists of two language processor environments. For task 2, the chain has only one language processor environment.The two environments on task 1 are interrelated and share system resources. The two chains are completely separate and independent.
Separate Chains on Two Different Tasks
As discussed previously,language processor environments are associated with an MVS task. Under an MVS task, IRXINIT can initialize one or more language processor environments. The task can then attach another task. IRXINIT can be called under the second task to initialize a language processor environment. The new environment is chained to the last environment under the first task. Figure below illustrates a task that has attached another task and how the language processor environments are chained together.
One Chain of Environments For Attached Tasks
As shown in above figure, task 1 is started and IRXINIT initializes an environment (environment 1). IRXINIT is invoked again to initialize a second language processor environment under task 1 (environment 2). Environment 2 is chained to environment 1. If you invoke a REXX exec within task 1, the exec runs in environment 2.
Task 1 then attaches another task, task 2. IRXINIT is called to initialize an environment. IRXINIT locates the previous environment, which is environment 2, and chains the new environment (environment 3) to its parent (environment 2). When IRXINIT is called again, IRXINIT chains the fourth environment (environment 4) to its parent (environment 3). At this point, four language processor environments exist on the chain.
Locating a Language Processor Environment
A REXX environment is considered integrated into TSO/E if the address space is a TSO/E address space and the environment has the TSOFL flag set on. Otherwise the environment is not integrated into TSO/E (TSOFL flag off). For the following discussion, a REXX environment that is integrated into TSO/E will be referred to as a ″TSO/E environment″; and a REXX environment that is not integrated into TSO/E will be referred to as a ″non-TSO/E environment.″
Whenever you invoke a REXX exec or routine, the exec or routine must run in a language processor environment. The one exception is the initialization routine, IRXINIT, which initializes environments.
In the TSO/E address space, the system always initializes a default language processor environment when you log on TSO/E and when you invoke ISPF.
If you call a REXX programming routine from TSO/E, the routine runs in the environment in which you called it. If you invoke an exec using the IRXJCL or IRXEXEC routine, a language processor environment may or may not already exist. If an environment does not exist on the
the system calls the IRXINIT routine to initialize an environment before the exec runs. Otherwise, the system locates the current non-reentrant environment and the exec runs in that environment.
IRXINIT always locates a previous language processor environment. If an environment does not exist on the current task (TSO/E or non-TSO/E environment) or on a parent task (TSO/E environment only), IRXINIT uses the values in the IRXPARMS parameters module as the previous environment.
A language processor environment must already exist if you call the TSO/E REXX
programming routines IRXRLT, IRXSUBCM, IRXIC, IRXEXCOM, and IKJCT441 or the replaceable routines. These routines do not invoke IRXINIT to initialize a new environment. If an environment does not already exist and you call one of these routines, the routine completes unsuccessfully with a return code.
When IRXINIT initializes a new language processor environment, IRXINIT creates a number of control blocks that contain information about the environment and any REXX exec currently running in the environment. The main control block is the environment block (ENVBLOCK), which points to other control blocks, such as the parameter block
(PARMBLOCK) and the work block extension.
The environment block represents its language processor environment and is the anchor that the system uses on calls to all REXX programming service routines. Whenever you call a REXX programming service routine, you can pass the address of an environment block in register 0 on the call. By passing the address, you can specify in which language processor environment you want the routine to run. For example, suppose you invoke the initialization routine, IRXINIT, in a non-TSO/E address space. On return, IRXINIT returns the address of the environment block for the new environment in register 0. You can store that address for future use. Suppose you call IRXINIT several times to initialize a total of four environments in that address space.
If you then want to call a TSO/E REXX programming service routine and have the routine run in the first environment on the chain, you can pass the address of the first environment’s environment block on the call.You can also pass the address of the environment block in register 0 to all REXX replaceable routines and exit routines. Some service routines also allow the address of the environment block to be passed as a parameter, in place of using register 0. If the parameter is used in these cases, register 0 is ignored.
When a programming service routine is called, the programming service routine must determine in which environment to run. The routine locates the environment as follows:
Therefore, IRXINIT does not need to locate an environment in which to run. However, IRXINIT does locate a previous environment to determine what values to use when defining the new environment. The following summarizes the steps IRXINIT takes to locate the previous environment:
IBM-REXX Related Interview Questions
|IBM - VSAM Interview Questions||IBM DB2 Interview Questions|
|COBOL Interview Questions||IBM-JCL Interview Questions|
|IBM Mainframe Interview Questions||IBM Cloud Computing Infrastructure Architect V1 Interview Questions|
|IBM WebSphere MQ Interview Questions||IBM DataPower Interview Questions|
|Unix/Linux Interview Questions||Ibm Websphere Message Broker Interview Questions|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.