Work fields and temporary files across processes

When a child sees a blank field or an unexpected set of records, check the share class on the work field or temporary file and the invocation type on the child.

On this page

What a child shares

  • SUBPROCESS. All three share classes remain available. The child also shares the current record buffers and file positions.
  • RELATED. RELATED and DETACHED work fields and temporary files remain available.
  • DETACHED. Only DETACHED work fields and temporary files remain available. Check the exceptions below for a QUERY or a job step running as a separate task.

Every work field and temporary file (disk or memory) has a share class. The default invocation type depends on how the child is called.

  • Menu children are typically (and by default) defined as DETACHED invocations.

  • Job-step children are typically (and by default) defined as RELATED invocations.
  • Parent-Child invocations between two (for example INPUT) processes are typically (and by default) defined as SUBPROCESS invocations.
  • Direct ILF verb invocations (ex: ILF verb 'INPUT') are by default defined as DETACHED invocations.
For example, if a DETACHED workfield or tempfile is referred to by a DETACHED child invocation, parent and child share that workfield/tempfile.

But if a RELATED or SUBPROCESS workfield/tempfile is referred to by a DETACHED child, the child creates a new copy of that workfield/tempfile.

Record buffers, field contents (including Working Storage fields), and file pointers are all available transparently through a SUBPROCESS invocation. They are not maintained for RELATED or DETACHED process invocations.

QUERY setup and runtime

Query(Setup) inherits inbound workfields/tempfiles according to normal scoping rules. But it passes workfields/tempfiles only to Query(Runtime) execution.

Query(Runtime) inherits inbound workfields/tempfiles only from its associated Query(Setup). It can pass nothing to any subsequent JOB step. The exception to this is that --- PROCESS CODE can be used to pass limited information into and out of Query processes. But --- PROCESS CODE should only be used for SPEED II compatibility issues. See ECR #2805 for further explanation.

JOB steps in a separate task

No workfield or tempfile information can 'come back' from a JOB step whose 'Sep Tsk?' (Separate Task) flag is set to 'Y'. This is because a JOB step process that could be spawned into an independent thread has no facility for communicating back to the original parent process, save by means of a disk/permanent file. See APPX Background Processing for further discussion.

Comments:

Read what other users have said about this page or add your own comments.


 
Topic revision: r4 - 03 Dec 2026, AdminUser - This page was cached on 03 Dec 2026 - 19:41.

Powered by Foswiki. Wiki content belongs to its contributing authors.