ŸIt is good practice to periodically (such as once a day) dele data queue at a safe point. Performance can be affected if to exist without being removed. Re-creating the data queue periodica the data queue to its optimal size.

Similarities to Message

Queues:

Data queues are similar to

message

queues,

that programs can send data to a queue and

that

data can

be rec

another program. However, more than one program

can have a receive op

pending on a data queue at the same time, while

only

one program

c

receive operation pending on a message queue

at the same time. (Onl

program receives an entry from a data queue,

even

 

if

more

than

one

waiting.)

Entries

on a

data queue are handled

in either first-in firs

last-in-first-out, or keyed-queue order. When an

entry

is

received,

it

from the

queue.

 

 

 

 

 

 

 

User

Queue

APIs

 

 

 

 

 

The

user

queue APIs let you create and deleteUser queues user arequeues.

permanent

objects

with

an

object type of *USRQ. They provide a way

more processes

to

communicate asynchronously.

You

can

use

user

queues

to:

Ÿ

Communicate

between

two

processes asynchronously

Ÿ

Store

data in arrival sequence for later use

Ÿ

Contain

keyed

messages

 

Ÿ

Create

a

batch machine

 

ŸPermit better performance than the data queue interface

You can save and restore user queues. However, you can only save o definition. You cannot save or restore the messages in it. You cannot user queue if a user queue with the same name already exists in must provide programs to use this object type to enqueue and deque

User Index APIs

The user index APIs allow you to:

Ÿ

Create and delete

user

indexes

 

 

Ÿ

Add, retrieve,

and

remove

user

index

entries

Ÿ

Retrieve the

attributes

of a

user

index

A user

index

is

an

object

that allows

search functions for data in th

automatically

sorts data based on the

value of the data. User inde

nent

objects

in

the

user

domain

or

in

the system domain. They have

of

*USRIDX

and

a

maximum

size

of

4

gigabytes (4 294 967 296 bytes).

help streamline table searching, cross-referencing, and ordering of da

general,

if your

table

is

longer

than

1000 entries,

an

index performs

user-sorted

table.

 

 

 

 

 

 

 

 

 

 

 

You

can use user indexes to:

 

 

 

 

 

 

 

Ÿ

Provide

search

functions

 

 

 

 

 

 

 

 

Ÿ

Do faster

insert

operations

than in

a

database

file

Ÿ

Do faster retrieve operations than in

a

database file

Ÿ

Create an

index

by

name, such

as

a

telephone

directory

Ÿ

Use

order

entry

programs

 

 

 

 

 

 

 

Ÿ Look

up

abbreviations

in

an

index

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Chapter

8.

Use of

OS/400

8APIs-13

Page 189
Image 189
IBM Version 4 manual User Index APIs, 8APIs-13, Usridx