Local data area

A local data area is created for each job in the system, including autostart jobs, jobs started on the system by a reader, and subsystem monitor jobs.

The system creates a local data area, which is initially filled with blanks, with a length of 1024 and type *CHAR. When you submit a job using the SBMJOB command, the value of the submitting job's local data area is copied into the submitted job's local data area. You can refer to your job's local data area by specifying *LDA for the DTAARA keyword on the CHGDTAARA, RTVDTAARA, and DSPDTAARA commands or *LDA for the substring built-in function (%SST).

The following is true of a local data area:

  • The local data area cannot be referred to from any other job.
  • You cannot create, delete, or allocate a local data area.
  • No library is associated with the local data area.
  • You cannot change the local data area in a secondary thread.
  • The ILE CL compiler generates code to ensure that a procedure running in a secondary thread cannot access the local data area while a procedure running in the initial thread is changing it.

The local data area contents exist across routing step boundaries. Therefore, using a Transfer Job (TFRJOB), Transfer Batch Job (TFRBCHJOB), Reroute Job (RRTJOB), or Return (RETURN) command does not affect the contents of the local data area.

You can use the local data area to:

  • Pass information to a procedure or program without the use of a parameter list.
  • Pass information to a submitted job by loading your information into the local data area and submitting the job. Then, you can access the data from within your submitted job.
  • Improve performance over other types of data area accesses from a CL procedure or program.
  • Store information without the overhead of creating and deleting a data area yourself.

Most high-level languages can also use the local data area. The SBMxxxJOB and STRxxxRDR commands cause jobs to start with a local data area initialized to blanks. Only the SBMJOB command allows the contents of the submitting job's local data area to be passed to the new job.