CICS Manual do Usuário - Temporary storage control

Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. -

Temporary storage control

The CICS temporary storage control program provides the application programmer with the ability to store data in temporary storage queues, either in main storage, or in auxiliary storage on a direct-access storage device.
Data stored in a temporary storage queue is known as temporary data. Temporary storage provides a scratch-pad area for holding data created by one transaction, to be used later by the same transaction or by a different one.

You can:

  • Write data to a temporary storage queue (EXEC CICS WRITEQ TS command)

  • Update data in a temporary storage queue (EXEC CICS WRITEQ TS REWRITE command)

  • Read data from a temporary storage queue (EXEC CICS READQ TS command)

  • Read the next data from a temporary storage queue (EXEC CICS READQ TS NEXT command)

  • Delete a temporary storage queue (EXEC CICS DELETEQ TS command)

Temporary storage queues

Temporary storage queues are identified by symbolic names that may be up to eight characters assigned by the user application during program execution.
Temporary data can be retrieved by the originating task or by any other task using the symbolic name assigned to it.
To avoid conflicts caused by duplicate names, a naming convention should be established, for example, the operator identifier, terminal identifier, or transaction identifier could be used as a prefix or suffix to each programmer-supplied symbolic name.
Specific items (logical records) within a queue are referred to by relative position numbers.

Temporary storage queues remain intact until they are deleted by the originating task, by any other task, or by a cold start; before deletion, they can be accessed any number of times.
Even after the originating task is terminated, data on temporary storage queues can be accessed by other tasks through references to the symbolic name under which it is stored.

Temporary data can be stored either in main storage or in auxiliary storage.

  • Main storage

    Generally, main storage should be used if the data is needed for short periods of time and does not require recovery.
    Data in main storage does not survive from one CICS run to the next.
    Main storage might be used to pass data from task to task, or for unique storage that allows programs to meet the requirement of CICS that they be quasi-reentrant (that is, serially reusable between entry and exit points of the program).

  • Auxiliary storage

    In CICS, auxiliary storage is a physical file.
    Auxiliary storage should be used to store large amounts of data or data needed for a long period of time.
    Data stored in auxiliary storage is retained after CICS termination and can be recovered in a subsequent restart.
    In CICS, data in auxiliary storage can be designated as either recoverable or nonrecoverable.
    This is indicated in the temporary storage table.

For a description of main and auxiliary storage queue usage, see Temporary storage.

Temporary storage commands

The EXEC CICS READQ TS command is used to read records from a temporary storage queue.
Queue records may be read sequentially by using the NEXT option, or randomly by using the ITEM option.
The EXEC CICS WRITEQ TS command is used to write records to a TS queue.
The EXEC CICS DELETEQ TS command is used to delete the entire temporary storage queue; you cannot delete an individual record. For a discussion of these commands, see Application programming commands - reference.

Typical uses of temporary storage control

A temporary storage queue having only one record can be treated as a single unit of data that can be accessed using its symbolic name.
Using temporary storage control in this way provides a typical "scratch-pad" capability.
This type of storage should be accessed using the EXEC CICS READQ TS command with the ITEM option; not doing so may cause the ITEMERR condition to be raised.

In general, temporary storage queues of more than one record should be used only when direct access or repeated access to records is necessary.
(Transient data control is better for efficient handling of sequential files.)

Some uses of temporary storage queues are:

Terminal paging
A task could retrieve a large master record from a direct-access file, format it into several screen images (using basic mapping support), store the screen images temporarily in auxiliary storage, and then ask the terminal operator which "page" (screen image) is desired.
The application programmer can provide a program (as a generalized routine or unique to a single application) to advance page by page, advance or back up a relative number of pages, and so on.

A suspend file
Suppose a data collection task is in progress at a terminal.
The task reads one or more units of input and then allows the terminal operator to interrupt the process by some kind of coded input.
If not interrupted, the task repeats the data collection process.
If interrupted, the task writes its "incomplete" data to temporary storage and terminates.
The terminal is now free to process a different transaction (perhaps a high-priority inquiry).
When the terminal is available to continue data collection, the operator initiates the task in a "resume" mode, causing the task to recall its suspended data from temporary storage and continue as though it had not been interrupted.

Preprinted forms
An application program can accept data to be written as output on a preprinted form.
This data can be stored in temporary storage as it arrives.
When all the data has been stored, it can first be validated and then transmitted in the order required by the format of the preprinted form.

© Copyright IBM Corp.