Data

Queue

APIs

 

 

 

 

Data

queues

are a

type of system object that you can create, to

level

language

(HLL)

program can send data, and

from which another

HLL p

can

receive

data.

The receiving program can be

waiting for the

data,

receive

the

data

later.

 

 

The advantages of using data queues are:

ŸUsing data queues frees a job from performing some work. If the interactive job, the data queue APIs can provide better response decrease the size of the interactive program and its process act (PAG). This, in turn, can help overall system performance. For example,

several work station users enter a transaction that involves updating adding to several files, the system can perform better if the int submit the request for the transaction to a single batch processing

ŸData queues are a fast means of asynchronous communication between jobs. Using a data queue to send and receive data requires less

 

resource

than

using

database

files,

message

queues,

or

data

areas

 

and

receive data.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ÿ

You

can

send

to,

receive

 

from,

and

retrieve

 

a

description

of

a

d

 

any

HLL program. This is done by calling the Send

to

a

Data

Queue

 

(QSNDDTAQ), Receive from Data Queue (QRCVDTAQ), Retrieve Data Queue

 

 

Message

(QMHRDQM),

Clear

Data

Queue (QCLRDTAQ),

and

Retrieve

Data

 

 

 

Queue

Description

(QMHQRDQD)

APIs.

 

 

 

 

 

 

 

 

 

 

 

 

Ÿ

When

 

receiving

data

from

a

data

queue,

you

 

can

set a time-out su

 

job

waits until an entry arrives

on

the

data

queue. This

is

diffe

 

the

EOFDLY parameter

on

the

Override

Database

File

(OVRDBF)

command,

 

which

causes

the

job

to

be

activated

whenever

the

delay

time

en

ŸMore than one job can receive data from the same data queue. This

advantage

in

certain

applications

where the

number of entries to be

is greater

than

one

job can handle within

the desired performance

For example, if several printers

are available to print orders, seve

jobs could send requests to a

single data queue. A separate job

printer could receive data from

the data queue in first-in-first-out

first-out

(LIFO),

or

keyed-queue

order.

 

ŸData queues have the ability to attach a sender ID to each mes placed on the queue. The sender ID, an attribute of the data qu established when the queue is created, contains the qualified job current user profile.

Comparisons with Using

Database

Files

as Queues:

 

The

following describes

the differences between

using

data

queues

and

database

files:

Ÿ Data

queues

have

been

improved

to

communicate

between

active progra

not to store large volumes of data

or large numbers of entries. For

poses,

use

database files

as

queues.

 

 

 

ŸData queues should not be used for long-term storage or indefinite

data. For this purpose, you should use database files.

ŸWhen using data queues, you should include abnormal end procedures programs to recover any entries not yet completely processed befor system is ended.

8-12System API Programming V4R1

Page 188
Image 188
IBM Version 4 manual Clear Data Queue Qclrdtaq Retrieve Description, Lifo, Following describes