There is an NCL processing environment for each window of your terminal that allows commands and NCL processes to execute on behalf of that window.
When you use an EXEC or START command to invoke an NCL process, the NCL process executes in the NCL processing environment for the OCS window.
Note: If you enter the EXEC or START command incorrectly, the system attempts to execute the command as if it were an NCL process.
Any NCL process can have a dependent processing environment that lets it issue commands or execute other NCL processes independently using the &INTCMD statement. NCL procedures can also use ROF sessions to collect information from other systems.
An OCS window can execute a serial stream of NCL processes so that they are invoked one after the other. Serial execution is suitable for processes with a short duration.
To execute NCL processes serially, use the EXEC command.
Processes invoked by the EXEC command can issue the &PAUSE statement to wait for further input from the OCS window. The GO, END, FLUSH, and INTQ commands, together with the process’s unique identifier, let you communicate with the process.
Example: Execute Processes in Sequence
To execute PROC1 and PROC2 in sequence, enter the following commands:
EXEC PROC1 EXEC PROC2
Your OCS window places the two processes in an EXEC queue, which are executed on a first-come, first-served basis. Process PROC1 is scheduled for immediate execution and process PROC2 is queued to execute after PROC1 ends.
An OCS window can execute NCL processes in parallel at the same time.
To execute NCL processes concurrently, use the START command. If you enter the name of an NCL procedure by itself, the START command is implied.
Any started procedure can issue an &PAUSE statement to wait for further input from GO, END, and FLUSH commands from the OCS window. These commands, together with the unique identifier for the process, let you communicate with the process explicitly.
Example: Execute NCL Processes Concurrently
To execute PROC1 and PROC2 at the same time, enter the following commands:
START PROC1 START PROC2
Each NCL process is allocated a unique identifier that links it to the issuing OCS window. This ensures any &WRITE or &PANEL statements issued by the NCL process (or any other processes it starts or executes), are returned to that window only. If the window is terminated, any queued process is deleted.
An NCL process executed from an OCS window (or any process it invokes) can itself issue EXEC or START commands.
If an EXEC command is used to execute an NCL process, the process issuing the command is suspended when the new process starts executing. Only when the new process ends does the issuing process resume processing.
Invoking a process from another process in this way is called nesting. Nesting is an easy way to structure a series of processes.
Note: The &CALL PROC NCL statement is the recommended method for nesting procedure calls.
If a START command is used to execute an NCL process, the new process starts executing immediately. The new process runs concurrently with the invoking process and independently of it. Each process is unaffected by the termination of the other process.
Using the START command to invoke NCL processes has the following advantages:
| Copyright © 2010 CA. All rights reserved. |
|