100% found this document useful (2 votes)
2K views

Datacom Presentation

Uploaded by

suzeet
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

Datacom Presentation

Uploaded by

suzeet
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 49

DATACOM

VIJAYKUMAR.R

December, 2003 DATACOM 1


DATACOM
Databases: A CA-Datacom/DB information base can include up
To 5,000 databases. Each database consists of an Index Area
and 1 to 240 data areas.

Data Areas:
A data area provides the physical storage for data tables. A database can
have multiple data areas. Each data area can support 1 to 240 tables, but
a database is limited to 240 tables as well. Every data area is a data set
or file. You can assign several tables to the same area or each table to a
separate area.Placing multiple tables in the same area can increase
Processing speed when Applications normally access the tables together
with the same key.

December, 2003 DATACOM 2


Datacom Contd.,

Index Area (IXX): The Index Area provides fast access to the data. Each
database contains one Index Area which provides accessibility to all data
areas within that database. The index allows any table in the database to
be retrieved based on the contents of the table. CA-Datacom/DB places
an entry in the index for each key within each table in the database.

Tables: All data is stored in tables. Tables are two-dimensional,


logically made up of rows (records) and columns (fields). Tables
are easily extendable with the addition of both rows and columns.

Columns: Columns are the smallest data structures in the Information


base. For SQL access, columns are the unit of transfer between the
database and the application program. Through Data dictionary, columns
Are defined using the FIELD entity-type.

December, 2003 DATACOM 3


Elements: For access with CA-Datacom/DB commands, columns make
up elements and elements are the unit of transfer. You can define 255
elements per table.

Keys: Keys are structures used to optimize data access or order data
Retrieval. A key is composed of columns. The columns can be in any
sequence. Each key can be up to 180 characters long.

You can define up to 99 keys per table or 999 per database. Any key can
be defined as unique, that is, requiring that each row in the table have a
unique value for the key.

All tables must have a Master Key and a Native Key defined. The Master
Key functions as any other key but it can be defined as updateable or non-
updateable. The Native Key dictates the physical sequence in which the
data is stored. The Native Key can be the same as the Master Key.

December, 2003 DATACOM 4


Master Key : Every table must have a Master Key. A table's Master Key
may be The same as its Native Key.

There is method of preventing duplicate values in Master key. This


method involves the TABLE attribute DUPE-MASTER-KEY which
specifies whether duplicate values are permitted in the Master Key.

This option differs from the KEY attribute UNIQUE in the following ways:
DUPE-MASTER-KEY can only be defined through Datadictionary.
UNIQUE can be defined through Datadictionary or SQL.

It may only be specified for one key (the Master Key) per table. UNIQUE
may be specified for any number of keys.
Attempted violations to DUPE-MASTER-KEY receive CA-Datacom/DB
return code 10. Attempted violations to a UNIQUE KEY receive CA-
Datacom/DB return code 94 (internal return code 193).

December, 2003 DATACOM 5


Native Key :
Every table must have one, and only one, Native Key. This
key designates the sequence in which the data is loaded and
maintained. Often used in sequential processing.

Dataviews:
Dataviews are special structures used by CA-Ideal and CA-Meta
COBOL+. Dataviews provide a logical view of the data. They can
be composed of elements or keys.

December, 2003 DATACOM 6


Primary Keys:
Each table may have one primary key. A primary key provides a
guaranteed method of addressing each row in a table. The primary key
value for each row is unique within the table. Defining a primary key
through SQL results in a key with the UNIQUE attribute. The resulting key
is also that table's Master and Native Key, unless the primary key is being
added to an existing table which already has a (different) Master and
Native Key.

Foreign Keys:
Foreign keys define relationships between tables. The column(s) of a
foreign key in one table are related to the primary or unique key of some
table. Every foreign key is related to a primary or unique key. A primary
or unique key can be related to zero, one, or many foreign keys.

December, 2003 DATACOM 7


• CA-Datacom/DB Modes of Operation :

CA-Datacom/DB has two modes of operation: Multi-User and


Single User. The recommended mode is Multi-User.

• Multi-User: The Multi-User mode enables CA-Datacom/DB to


access a database concurrently from multiple regions. The
Multi-User Facility is the manager of the system. It receives a
request from the application and determines how it should be
processed. It coordinates the activities that must take place to
service the request.

• Single User: The Single User mode allows only one region to
access a database.

December, 2003 DATACOM 8


DBUTLTY: CA-Datacom/DB provides a single utility, the CA-Datacom/DB
Utility (DBUTLTY), that performs all operations for creating and
maintaining your information base. You invoke the functions by entering
commands to the utility program.
Eg

//UTLTY30 EXEC PGM=DBUTLTY,COND=(0,NE)


//* ***********************************************************
//* * UTLTY30 - DISABLE DATA BASE 168 - AGENT *
//* ***********************************************************
//CXX DD DSN=D1A.MUFI1.CXX,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=U,
// HOLD=YES
//ABNLTERM DD SYSOUT=*
//SNAPER DD SYSOUT=*
//LOCKDD DD DSN=K1C.KFS.DB168.DSLOCK,
// DISP=OLD
//SYSIN DD DSN=ASA.PPRD.ZKL.SYSIN(MTN168),
// DISP=SHR
//*
//*

December, 2003 DATACOM 9


To create a complete backup of a database using DBUTLTY, execute
the BACKUP DBID=n function with the control statement coded
SEQ=PHYSICAL, RECID=YES,UPDATE=YES. This safe backup can
only be done with the area not open for update by any application.

When you are backing up a table or area, suspend all update activity
to it.

December, 2003 DATACOM 10


Accessing CA-Datacom/DB Databases from Applications

Applications can access CA-Datacom/DB databases by including CA-


datacom/DB commands or SQL statements in their code.

CA-Datacom/DB commands are included within a call to a CA-


Datacom/DB entry point. These calls can be included in applications
written in Assembler, C language, COBOL, FORTRAN, and PL/I.

CA-Datacom/DB commands provide two access techniques:


record-at-a-time (RAAT) and set-at-a-time (SAAT).

RAAT:
The record-at-a-time commands access data rows (records) and Index
entries.The rows are selected by specifying a previously defined key name
and a key value.

December, 2003 DATACOM 11


RAAT:
The rows are retrieved in the sequence of the key, in either ascending or
descending order. A record with the exact, greater-than-or-equal, or less-than-or-
equal key value specified may be selected.

SAAT:
With the set-at-a-time access technique, a set of records is defined based on the
data values contained in a table. A set can be just one record, or an entire table.
Once a set has been defined, individual records within the set can be accessed.
Records contained in a set are selected by specifying a search condition. A
search condition is a compound Boolean expression composed of predicates
joined by the logical operators AND and OR.
Relational operators used in the search are : EQ, LT, GT, LE, GE, NE

Eg : VENDR-NAME EQ HCLT AND BR-PIN-CODE GE 600034

December, 2003 DATACOM 12


Accessing CA-Datacom/DB Databases Using Other
Computer Associates Products

CA-Ideal: CA-Ideal enables you to develop and maintain applications that can
access CA-Datacom/DB databases. CA-Ideal passes CA-Datacom/DB
commands to the CA-Datacom/DB entry point. It uses both record-at-a-time and
set-at-a-time access techniques. CA-Ideal also offers you the option of using
SQL statements within your CA-Ideal programs.

CA-Dataquery: CA-Dataquery is an information retrieval and data manipulation


facility. It allows end users to create queries that retrieve information from a CA-
Datacom/DB database. CA-Dataquery can access CA-Datacom/DB using CA-
Datacom/DB commands or SQL statements. CA-Dataquery also provides a
Personal Database Facility which allows users to create and maintain personal
tables.

December, 2003 DATACOM 13


Creating Databases

Each CA-Datacom/DB database can contain from 1 to 240 tables.

Information stored in one database is independent of that in other databases.


Information in the same database is indexed in the same Index Area
(IXX).Therefore, a disk error on the Index Area affects all tables in the
database.

It is best to use a separate database for data that is relatively unrelated.


For example, use separate databases for:
• Independent application systems, such as accounts payable, general
ledger, or inventory.
• Information about independent subjects, such as customer information,
inventory information or accounting information.

December, 2003 DATACOM 14


The steps required for creating CA-Datacom/DB databases are:

• Design the logical structure for the databases.

• Design the physical attributes for the databases.

• Use Datadictionary to define the databases, areas, tables, columns, keys and
elements.

• Catalog the definitions to the CA-Datacom/DB Directory (CXX).

• Allocate and initialize the required data areas and Index Areas.

• Use programs or utilities to actually load data in the tables.

December, 2003 DATACOM 15


Designing Columns

A column (FIELD occurrence) is the smallest data


structure in CA-Datacom/DB. You must define at least
one column to a table.You can define up to 500
columns to a single table.

December, 2003 DATACOM 17


Data Types DATE, TIME, and TIMESTAMP

• DATE, TIME, and TIMESTAMP are special SQL data types that
are stored and manipulated in CA-Datacom/DB as binary data
with lengths 4, 3, and 10 respectively.

• In COBOL, the data type of the host variable to receive or send a


DATE, TIME or TIMESTAMP must be CHARACTER.

• The internal formats for the three types are:

DATE CCYYMMDD
TIME HHMMSS
TIMESTAMP CCYYMMDDHHMMSSNNNNNN

December, 2003 DATACOM 18


Where Represents

CC Century
YY Year
MM Month
DD Day
HH Hour
MM Minute
SS Second
NNNNNN Microseconds

Example :

05 WS-DATE PIC X(08) VALUE SPACES.


05 WS-TIME.
10 WS-HOUR PIC XX VALUE SPACES.
10 WS-MINUTE PIC XX VALUE SPACES.
10 WS-SECOND PIC XX VALUE SPACES.

December, 2003 DATACOM 19


Columns Accepting Null Values

When a column is defined to accept null values, CA-


Datacom/DB places a value in the null indicator for the
column when an application adds a row to the table without
supplying a value for the column.
Nil Values: A null is not a nil value. A nil value is a
character blank (X'40') or a binary zero (X'00'), which CA-
Datacom/DB treats as non-null values. The KEY attribute
INCLUDE-NIL-KEY determines whether CA-Datacom/DB
indexes rows with nil values for the key. A key has a nil
value when all of the columns in it have the same nil value.
How to Define Columns to Be Unique?

• Specifying that a column (or group of columns) be unique ensures


that each value in the column exists only once in the table.

• To be defined as unique, a column or group of columns must not


exceed 180 bytes in length.

To define a column as unique, define a single-column key, specifying:


• Yes for the KEY attribute UNIQUE
• Yes for the KEY attribute INCLUDE-NIL-KEY
• No for the FIELD attribute NULL-INDICATOR

December, 2003 DATACOM 21


When an application attempts to add a row containing a
duplicate value for a column or columns defined as
unique, CA-Datacom/DB does not immediately reject
the add if the existing row is not committed. If the value
is committed as present, CA-Datacom/DB aborts the
row add and issues the CA-Datacom/DB return code 94
(internal return code 193). If the value is committed as
absent, the add continues.

December, 2003 DATACOM 22


Inserting and Accessing Records
The value of the key column MUST be provided during an insert for CA-
Datacom/DB to correctly place the new record.
CA-Datacom/DB takes the value and manipulates it to obtain the block
number where the record should go. This block is read and CA-
Datacom/DB indexes into the block to the correct physical location. If the
space has no RCE(Record Control Element which is 4bytes long), the
record is added. If an RCE exists, the add fails with a duplicate unique
key. The first two bytes of the RCE must be the length of the data record.
The third byte of the RCE must be the binary table ID. The last byte in the
RCE must be a binary zero.

The key value presented is converted into a block number


and record within block. This block is read and CA-Datacom/DB positions
to the record. If no RCE is found, the return code is 14.

December, 2003 DATACOM 23


CA-Datacom/DB Return Codes
CA-Datacom/DB passes a return code to the Request Area
of a program in response to the program issuing a CA-
Datacom/DB command. CA-Datacom/DB also issues return
codes within CA-Datacom/DB messages.

A return code of blanks indicates successful processing of


the command. A non-blank return code indicates an error .
All non-blank return codes have one or more associated
internal return codes.

December, 2003 DATACOM 24


Example :
10 AFB-REQ-RETURN-CODE PIC X(002) VALUE SPACE.
88 AFB-GOOD-RETURN VALUE SPACE.
88 AFB-TABLE-NOT-OPEN VALUE '05'.
88 AFB-TABLE-NOT-OPEN-4-UPDATE VALUE '06'.
88 AFB-DATA-AREA-FULL VALUE '07'.
88 AFB-INDEX-FULL VALUE '08'.
88 AFB-PREREQUISTE-NOT-FOUND VALUE '09'.
88 AFB-DUP-MASTER-KEY-NOT-ALLWD VALUE '10'.
88 AFB-MASTER-KEY-MOD-UPT-REJ VALUE '11'.
88 AFB-RECORD-NOT-FOUND VALUE '14'.
88 AFB-EXCLUSIVE-CNTL-DUPLICATE VALUE '18'.
88 AFB-END-OF-FILE VALUE '19'.
88 AFB-ELEMENT-NAME-NOT-FOUND VALUE '22'.
88 AFB-ELEMENT-SECURITY-CD-VIOL VALUE '23' .

December, 2003 DATACOM 25


Steps used to retrieve data from CA-Datacom/DB in an Appln program:

• Establishes communications with CA-Datacom/DB using a User


Requirements Table.
• Issues CA-Datacom/DB requests using the Call Stmt and checks the result.
• Terminates communications with CA-Datacom/DB.

User Requirements Tables :


• A User Requirements Table controls the features at the program level.
• Defines which CA-Datacom/DB tables can be accessed/updated by CA-
Datacom/DB commands .
• It specifies what resources are necessary for the successful execution
of a program, including additional resources the program can need,
such as extra buffer allocations.

December, 2003 DATACOM 26


Access Using a User Requirements Table

The User Requirements Table is generated by a macro assembly and is


either link-edited with your program or dynamically loaded at execution
time. It contains an entry for each CA-Datacom/DB table your program
Accesses.

The User Requirements Table must be opened before your program


requests access to CA-Datacom/DB tables, and closed after all requests
have been made.

You can specify in the User Requirements Table that CA-Datacom/DB open the
User Requirements Table before control is passed to your program, and close the
User Requirements Table when your program returns control to CA-Datacom/DB.
Alternately, your program can open and close the User Requirements Table itself
by issuing OPEN and CLOSE commands.

December, 2003 DATACOM 27


Eg..

//CSTMTL76 EXEC PGM=K1CSTMTL,PARM='DBURT=K1CSTMU1‘, COND=(0,NE)

//*
//TOC DD DSN=K1C.KFS.K1CSTMTS.K1CTOC2N,
// DISP=SHR
//SPX DD DSN=K1C.KFS.K1CSTMTS.K1CPRT2N,
// DISP=SHR
//*
//LASER DD DSN=K1C.KFS.PRINTW.K1CSTMTL.K1CSTM02,
// DISP=(NEW,CATLG,DELETE),
// UNIT=PRDPK,SPACE=(TRK,(2250,150),RLSE),
// DCB=(RECFM=FBA,LRECL=255,BLKSIZE=0)
//*

December, 2003 DATACOM 28


Entry Macro (DBURTBL)
A DBURTBL macro is required for each CA-Datacom/DB
table to be accessed by CA-Datacom/DB commands.

Example:
DBURTBL X
ACCESS=RAN, X
AUTODXC=YES, X
BYPOPEN=NO, X
DBID=&POLICY, X
ELMCHG=NO, X
GBMAXR=255, X
GETBLK=15000, X
SEQBUFS=00, X
SYNONYM=NO, X
TBLNAM=AGT, X
UPDATE=NO
EJECT
BYPOPEN=value

Indicates the processing of the table specified in the TBLNAM=parameter during


User Requirements Table open and close processing,as follows:

BYOPEN=NO means the table specified in the TBLNAM parameter Is not


bypassed.

BYOPEN=YES means the table specified in the TBLNAM parameter Is bypassed


during open and close processing.

Valid Entries: NO or YES

Default Value: NO

December, 2003 DATACOM 30


AUTODXC=value

Valid Entries: NO or YES


Default Value: YES

AUTODXC=No means ,Do not automatically drop exclusive control.


If NO is specified and the record is not updated or deleted, the program
must release exclusive control.

AUTODXC=Yes means, Automatically drop exclusive control established


by the previous command from the same Request Area.
-------------------------------------------------------------------------------------------------
ACCESS= RAN
Starting with Version 8.1, this parameter was no longer required.

December, 2003 DATACOM 31


UPDATE= value

Valid Entries: NO or YES


Default Value: NO

UPDATE=No means, The program cannot update this table and cannot
hold the rows under exclusive control.

UPDATE=No means, The program can update this table and can hold
the rows under exclusive control.

December, 2003 DATACOM 32


Start Macro (DBURSTR)
Eg
DBURSTR ABEND=YES, YES, NO X
CSECT=KFBATCH, DBURTRR X
MSTNAM=DBSULST, NO DEFAULT) X
MULTUSE=YES, YES, NO X
PRTY=7, 7 X
PXXAREA=NO, YES, NO X
TXNUNDO=NO, YES, NO
X
WRITE=NO YES, NO
EJECT
**************************************************************
PRTY= 7 (default)
This parameter establishes the priority for all CA-Datacom/DB requests
issued by the program after the User Requirements Table is opened.

Valid Entries: Integer value from 1 through 15

December, 2003 DATACOM 33


TXNUNDO=value

Valid Entries: NO or YES


Default Value: NO

If the value is Yes means the transaction backout option is in effect


for all update transactions against all the tables declared in this
User Requirements Table.

If TXNUNDO=No, it Specifies transaction backout is not


operational.

December, 2003 DATACOM 34


End Macro (DBUREND)

Code one DBUREND macro per User Requirements Generation


Macro set.

Example :

DBUREND X
SYSTEM=OS, X
USRINFO=KFBATCH
CSECT
DC CL50'L1ABATU193/03/0111:04:0698/06/16NONE 0000100001'
END

December, 2003 DATACOM 35


Issuing Requests
CA-Datacom/DB services are requested through the call facility of the
particular language you are using. The entry point DBNTRY should be
called with the following parameters:
• User Information Block (required)
• Request Area (required)
• Work Area (optional)
• Element List (optional)
• Request Qualification Area (optional)

SYNTAX
CALL 'DBNTRY' USING USER-INFO

REQUEST-AREA

I/O WORK AREA


In a COBOL-Datacom program, ENTRY statement is the first one
Following procedure division.

Example:

PROCEDURE DIVISION.
ENTRY 'DBMSCBL'.
EJECT
0000-MAINLINE.

The default entry point called by CA-Datacom/DB is DBMSCBL.


CA-Datacom/DB transfers control to DBMSCBL after opening the
User Requirements Table. An alternate name can be specified
with the USRNTRY=name parameter.

December, 2003 DATACOM 37


CALL STATEMENT

Example :
CALL 'DBNTRY' USING AFB-USER-INFO

AFB-REQUEST-AREA

I-AFB-TABLE
AFB-ELEMENT-LIST.

User Information Block is a 32-byte required area, which can be used to


identify the requestor of CA-Datacom/DB services. CA-Datacom/DB
does not require that any particular information be placed in this area, but
it is suggested that the program name be placed in the first eight
characters to aid in problem determination.

05 AFB-USER-INFO PIC X(032) VALUE 'K1CFINUP' .

December, 2003 DATACOM 38


CALL Syntax for Languages Other Than COBOL

Assembler uses a CALL macro, while PL/I and FORTRAN use a CALL statement.
Using the DBNTRY entry point, provide the appropriate User Information Block, the
Request Area address, the work area address, the element list address, and the
Request Qualification Area address in the call.

• Assembler Format
CALL DBNTRY,(userinfo,reqarea,wrkarea,elmlst,qualarea)

• PL/I Format
CALL DBNTRY(userinfo,reqarea,wrkarea,elmlst,qualarea)
DECLARE DBNTRY ENTRY OPTIONS(ASSEMBLER)

• FORTRAN Format
CALL DBNTRY(userinfo,reqarea,wrkarea,elmlst,qualarea)

December, 2003 DATACOM 39


Request Area

Required area is used to specify requests made to CA-Datacom/DB, and


then test the results.

You may even use more than one Request Area for the same table. For
example, one Request Area might be used to sequentially read an
employee table, and another to read the employee record for each
employee's manager.

The Request Area minimum length is 76-characters. Depending on the


command used, it is followed by one or two key value areas, which can be
from 1 to 180 characters long each.

December, 2003 DATACOM 40


05 AFB-REQUEST-AREA.
10 AFB-REQ-COMMAND PIC X(005).
10 AFB-REQ-TABLE-NAME PIC X(003) VALUE 'AFB'.
10 AFB-REQ-KEY-NAME PIC X(005) VALUE 'AFBK0'.
10 AFB-REQ-RETURN-CODE PIC X(002) VALUE SPACE.
88 AFB-GOOD-RETURN VALUE SPACE.
88 AFB-RECORD-NOT-FOUND VALUE '14'.
88 AFB-END-OF-FILE VALUE '19'.
10 AFB-REQ-INTRNL-RTNCD PIC X(001).
10 AFB-REQ-DATABASE-ID PIC S9(004) COMP.
10 AFB-REQ-TABLE-ID PIC S9(004) COMP.
10 AFB-REQ-RECORD-ID PIC X(005).
10 FILLER PIC X(025).
10 AFB-REQ-COUNT-MAX PIC S9(004) COMP.
10 AFB-REQ-IO-COUNT PIC S9(004) COMP.
10 FILLER PIC X(022).
10 AFB-REQ-KEY-VALUE.
COPY AFBRK0. .

December, 2003 DATACOM 41


Work Area

The work area is used with record update and add commands to pass
the elements listed in the element list, in the order listed, to CA-
Datacom/DB. The work area is also used, in conjunction with record
retrieval commands, to receive those elements back from CA-
Datacom/DB.
This area must be large enough to accommodate the combined length
of all the elements specified in the element list. If this area is too small,
record retrieval commands overlay whatever follows this area.

Eg:
01 I-AFB-TABLE.
COPY AFBTBL REPLACING ==:TAG:== BY ==I-AFB-==.

EJECT

December, 2003 DATACOM 42


Element List

The element list specifies which data elements are to be retrieved,


updated or added.
Eg:
05 AFB-ELEMENT-LIST.
10 FILLER PIC X(005) VALUE 'AFBE0‘.
10 FILLER PIC X(006) VALUE SPACES.
Command Code
The 5-character command name specifying the operation to be
Performed.

ADDIT Adding records to a database .


CLOSE Closing User Requirements Table .
DELET Deleting records from a database.
GSETL Set to Starting Key(prerequisite command to GETIT).
GETIT Sequentially retrieving elements from a database.
OPEN Opening User Requirements Table.
RELES Releasing exclusive control of records.
UPDAT Modifying elements in a database.
COMIT Committing a transaction.

December, 2003 DATACOM 44


Command Code
UPDAT Modifying elements in a database.
REDKX/RDUKX Retrieving data elements from the database
using the exact key value.

REDnn commands retrieve elements without exclusive control for


update. RDUnn commands retrieve elements with exclusive
control for update.

December, 2003 DATACOM 45


ADDIT (Add Record)
ADDIT inserts a record into a specified table

RETURN CODES:

Blanks THE COMMAND WAS SUCCESSFUL


05 TABLE NOT OPEN
07 DATA AREA FULL
10 DUPLICATE MASTER KEY NOT ALLOWED
08 INDEX FULL

DELET (Delete Record)

The DELET command deletes a record from a table and deletes all keys
associated with the record. DELET also releases exclusive control of the
record.

December, 2003 DATACOM 46


Before a record can be deleted, two conditions must be met. The record
must be read with exclusive control, and the table specified in this
command must have been defined in the User Requirements Table as a
table which may be updated.

GETIT (Retrieve Next Sequential Record)

In a batch environment, GETIT retrieves records sequentially from any


table in a database, sequenced by any valid key name, starting with a key
value greater than or equal to a specified key value. GETIT optionally
obtains exclusive control of a record.
The first GETIT for a table must be preceded by a GSETL command.
GSETL retrieves no data. It specifies the table name, key name, and key
value, obtaining positioning for subsequent sequential processing.

Return code
22 ELEMENT NAME NOT FOUND

December, 2003 DATACOM 47


REDBR/RDUBR (Read Backwards)

REDBR and RDUBR return actual data elements from a database by reading
the next record with the previous sequential entry in the index. RDUBR
acquires exclusive control for update purposes. REDBR does not obtain
exclusive control.

You identify the starting point at which to read backwards by issuing any
LOCKX command or any REDKX/RDUKX command.

REDKG/RDUKG (Read Record Greater Than/Equal to Key)

The REDKG/RDUKG command enables you to obtain the first record in a


table that has a key value in the index greater than or equal to the key value
requested.

RDUKG acquires exclusive control of the record for update purposes. REDKG
does not obtain exclusive control.

December, 2003 DATACOM 48


REDKL/RDUKL (Read Key Less Than or Equal to Key)

Use the REDKL/RDUKL command to obtain the first record in a table that has a
key value in the index less than or equal to the key value specified in the request.

RDUKL acquires exclusive control of the record for update purposes. REDKL
does not obtain exclusive control.

REDKR/RDUKR (Read Record in a Specified Range)


The REDKR/RDUKR command enables you to locate a record within a specified
key value range.RDUKR acquires exclusive control of the record for update
purposes. REDKR does not obtain exclusive control.

The beginning and ending key values of the range in a 360-byte key
Area has to be specified. REDKR/RDUKR uses these two values as boundaries
and locates the first record within the range.

December, 2003 DATACOM 49


Random Retrieval with Exact Key Value

Command Used: REDKX/RDUKX

The REDKX command can be used to retrieve elements of a single


record if the exact key value is known. If the record is not found, the
return code is set to 14. RDUKX acquires exclusive control of the record for
update purposes.
The exact full key value must be known to use this command.
REDKY/RDUKY is equivalent to REDKX/RDUKX and function in the same way.

Read Next Equal Key Value

Commands Used: REDNE, RDUNE

REDNE reads the next record with a key value equal to the key value specified.
RDUNE reads for update the next record with an equal key value.

December, 2003 DATACOM 50

You might also like