PROIV is fundamentally iterative. Functions are usually designed to be executed repeatedly against a set of data. In this scenario, the user has direct control of the application and determines what to do.

If a function is to be used in component mode, there is a fundamental difference: there may be a single iteration of the function against one set of data, with the data to be worked on being determined externally. There are, however, some implications if a function can be run in both the standard mode and component (Task) mode without changes:

For non-mainframe use, you can control the iteration of a screen function by using the new writable property CURRENTLS.ONETIME, which can be set to zero (for multiple iterations), or non-zero (for one-time or single-shot). This is not supported under the S/390 product.

Use CURRENTLS.ONETIME in conjunction with a new system variable, @TASK, to control the iteration. @TASK can be checked in logic to determine if the kernel is executing a Task. If there is no active Task (or one is yet to be loaded), it is null. This field is set by the kernel at the start of Task execution and is cleared when the Task is exited. The value of @TASK cannot be modified.

Comment on this topic

Topic ID: 540026